feat(repo): ship static repository showcase - #1791
Conversation
|
Read through the bundle, the exporter, the renderer, and the shipped golden. The unavailable-vs-zero discipline in here is the best part of the design: every collection that was not collected says so with a specific reason, and Two places where that discipline is not carried through. Both are small. 1. The symbol tier encodes "deferred" as
|
|
Two additions to the above, both of which change what fixing the symbol-tier item costs. Neither is a new objection; they are the parts I had wrong about scope. The contract test ratifies both encodings, side by side
assert_eq!(bundle.graph.functions.disclosure.status, DisclosureStatus::Complete);
assert!(matches!(bundle.graph.issues.total_count, Availability::Unavailable { .. }));So the test does not miss the inconsistency, it pins it. That is worth more than the original finding: the test's own name is the argument for which direction to resolve it. Whatever else changes, Changing the exporter silently staleness the golden, because nothing compares them
That is defensible on its own. Regenerating a 5.7 MB bundle per PR means a network clone and a full So the symbol-tier fix is three parts, not one:
Step 3 is the one worth being firm about. Hand-editing three fields inside a minified 5.7 MB artifact would produce a bundle that the generator does not reproduce, which is a worse version of the drift this PR's own guard comment claims to prevent. Which makes the three validation claims worth stating togetherReading the tree, this PR asserts three things are verified. One is:
The first two are worth closing because the mechanisms are already written and the wiring is one line each. The third is a reasonable thing to leave to a manual step, as long as nothing claims otherwise in a comment. |
`check:showcase` existed and nothing invoked it. The only two call sites of sync-showcase-assets.mjs were write mode: `prebuild` and the regeneration script. So CI ran the build, `prebuild` fired the writer, and the committed browser asset was overwritten in the runner. Drift between the two goldens was repaired in the workspace, the build went green, and the drift stayed in the repository. `pretest:e2e` is the same build, so the Playwright run could not catch it either. Placement is the load-bearing part: a check placed after the build reads bytes the build just rewrote and passes unconditionally. A gate that runs after the self-repair is the same defect wearing a fix's clothes. This also makes the size-guard exception in scripts/check-json-data.sh true as written. That comment cites CI validation of byte parity as the reason a 5.7 MB file is exempt from the 256 KB ceiling, and it is the text the next person widening that exception will read.
… zero SymbolPage::empty() built functions, datatypes and interfaces with total_count: available(0) and disclosure: complete, while carrying a reason string stating the tier was never ingested. Complete plus an available zero is a positive claim that the count was taken. The repository has 658 Rust modules. The renderer branches on disclosure.status == unavailable before it branches on an empty row set, so these three displayed a confident 0 where issues, pull requests, release tags and lead time all displayed their unavailable reason. The published schema carried the same claim to every other consumer. aggregate.rs already encoded the identical fact as Availability::unavailable, and the suite already contained a test asserting that zero-history ownership metrics are unavailable rather than zero, so the convention was established and the symbol tier was the outlier. The contract test asserted disclosure.status on one page and total_count on another, which is how the pairing survived a test named for explicitness. It now asserts both fields across all three pages. The reason string is bound once and shared, so the two fields cannot disagree. Golden regenerated through scripts/generate-repo-showcase.sh; the schema regenerated byte-identical, so the contract shape is unchanged.
…spatch moduleName() ran a linear find over all module items on every call, and the showcase views call it for hundreds of rows per render. Build the id-to-module map once per bundle with useMemo and pass it down, making each lookup O(1). Replace the ActiveView if-else chain with a component lookup map keyed by view id, matching the existing viewOrder/viewIcons structure.
Summary
khive.repo.v1Rust model, read-only two-store exporter, generated JSON Schema, and canonical khive golden vectorkhive repo buildandkhive repo export; build performs bounded public clone resolution, exhaustivegit.digest, Rust-onlycode.ingest, revision/provenance checks, derived commit-to-module linkage, and atomic export/, preserve the KG review workbench at/review, and render all ten D3 module/repository views from the precomputed bundleGolden and reproduction
The command pins
c2979d2443738a075e55a170c772d1dc86cf0f91, omits mutable forge/tag observations, regenerates the schema, and synchronizes the exact browser asset.8afa2c23668e632808a70955d42139488d9d5d467134358b2a4afe2c41843b4ca243828287337d2dab2da5529fc9b28882d3b7794204cd5e7f4184c59f4d6d11Join coverage
ohdearquant/khiveThe historical join records 7,558 changed-path events: 4,344 Rust events in scope, 4,309 matched, 3,214 non-Rust events out of scope, and 35 deleted/renamed/unscanned Rust events retained as named residuals.
View coverage and honest deferrals
All ten D3 views are implemented at their declared module/repository granularity: structure graph, history-structure navigation, dependency topology, hotspot quadrant, hidden coupling, structure treemap, cadence timeline, ownership, de-facto API surface, and scorecard.
Symbol drill-down, symbol sizing, symbol ranking, and symbol count remain explicitly unavailable because the current ingest emits no function/datatype/interface nodes. Pull-request/issue-to-module facets remain unavailable without an explicit commit evidence chain. The reproducible golden requests commits only, so each forge cadence series carries its own unavailable disclosure rather than invented zeroes.
Verification
cargo check --workspace --all-targets