feat(explorer): v0.8.10 — directory view, /new creation, /stats dashboard - #62
Merged
Conversation
….10] Implements rac/roadmaps/v0.8.x-explorer/v0.8.10-explorer-create-and-stats.md. Scopes: - /new artifact creation through Core's create service behind the v0.8.4 preview-and-confirm write workflow, with the ADR-024 boundary reasoning recorded (creation is correctness, not editing) - /stats portfolio view from the stats service, collected off-thread Defers rac init in the Explorer, directory creation, and stats export.
Implements rac/roadmaps/v0.8.x-explorer/v0.8.10-explorer-create-and-stats.md. Adds Initiative 3: a folders grouping that mirrors the repository's directory structure as the new sidebar default, with type and flat remaining selectable, and /browse <type> rendering in the filterable results view in every mode. Pins DirectoryNode on BrowserState.tree (ADR-015), dir:<relpath> expansion keys, the eager-but-collapsed build, and the folders → type → flat settings cycle.
…ap:v0.8.10] Implements rac/roadmaps/v0.8.x-explorer/v0.8.10-explorer-create-and-stats.md (Initiative 3). The sidebar gains a folders grouping — the new default — that renders the repository's real directory tree: nested directory nodes (name with a trailing slash and a dim artifact count, dir:<relpath> data keys pinned to posix) with artifact rows as leaves. The adapter builds the tree onto BrowserState.tree (ADR-015); expansion and cursor survive manual and watcher reloads at any depth, and /open reveals a nested artifact by expanding its ancestor chain. Settings cycle folders → type → flat; explicit type/flat values in existing config files stay honored. With type groups no longer the universal anchor, /browse <type> now lists that type in the filterable results view in every grouping mode (bare /browse still focuses the sidebar); the sidebar's focus_group is removed with its only caller (ADR-023).
…0.8.10] Updates the explorer CLI reference for the directory-mirroring sidebar (folders default, three-value grouping cycle, path-revealing /open) and the /browse results-view behaviour; extends the visual-system design's sidebar paragraph to match.
A 12-frame GIF of the Explorer's happy path — first launch through the directory sidebar, palette quick-open, reading, health, the editor handoff, and the live reload — captured headlessly against this repository's own corpus. External asset referenced from documentation (ADR-019).
Implements rac/roadmaps/v0.8.x-explorer/v0.8.10-explorer-create-and-stats.md (Initiatives 1 and 2 — the contract's remaining scope). /new <type> <path> previews the canonical template (ID noted as assigned on write) and y confirms through Core's create service — the only writer, minting the ID against the repository index and refusing existing paths, missing directories, and uninitialized repositories with recoverable guidance. The import view becomes the one write workflow, holding the pending writer with the preview; a successful creation reloads the repository and opens the new artifact, ready for e. Bare /new lists the creatable types. /stats opens a portfolio dashboard — per-type validity, requirement and quality totals, decision status and category breakdowns, relationship counts — collected from the stats service in a worker on request, never during repository load, and scrollable under the keyboard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements all three initiatives of
rac/roadmaps/v0.8.x-explorer/v0.8.10-explorer-create-and-stats.md— this PR delivers the complete v0.8.10 release: the sidebar mirrors the repository's actual directory structure,/newcreates artifacts through Core's create service behind a preview-and-confirm flow, and/statsopens a portfolio dashboard.The happy path, end to end (first launch → directory sidebar → palette quick-open → reading → health → editor handoff → live reload → settings):
Adds:
folderssidebar grouping — the new default — rendering directories as collapsible nodes (name with a trailing/and a dim artifact count), nested exactly as on disk; expansion and cursor survive manual and watcher-driven reloads at any depth, and/openreveals a nested artifact by expanding its ancestor chain/new [type] [path]: previews the canonical template (ID noted as assigned on write),yconfirms, and the write goes only through Core'screate_artifact— the ID is minted against the repository index; existing paths, missing directories, and uninitialized repositories refuse with recoverable guidance and nothing written. On success the Explorer reloads and opens the new artifact, ready fore. Bare/newlists the creatable types./stats: a portfolio dashboard — per-type validity, requirement/metric/risk totals, decision status and category breakdowns, relationship counts — collected from the stats service in a worker on request, never during repository load, scrollable under the keyboard/browse [type]listing in the filterable results view in every grouping mode (bare/browsefocuses the sidebar)Roadmap / ADR Trace
Roadmap:
rac/roadmaps/v0.8.x-explorer/v0.8.10-explorer-create-and-stats.mdRelevant ADRs:
rac/decisions/adr-015-explorer-as-consumer.md— the adapter builds the directory tree, renders templates viarender_artifact, and dashboards viacollect_stats; the Explorer owns no intelligencerac/decisions/adr-021-templates-product-contracts.md/adr-026-opaque-artifact-identities.md—/newrenders no templates and mints no IDs of its own; Core's create service is the only writerrac/decisions/adr-024-rac-not-content-store.md— creation is knowledge correctness, not editing: preview-confirmed structure, authoring hands off to the external editor; the boundary reasoning is recorded in the contractrac/decisions/adr-023-clean-break-internal-refactors.md—focus_groupremoved with its only callerrac/decisions/adr-028-explorer-surface.md— directory rows and dashboard sections carry text labels, never colour alonerac/decisions/adr-019-asset-management.md— the GIF lives as an external asset underdocs/images/Scope
Included
GROUPING_FOLDERSas theartifact_groupingdefault; settings cycle folders → type → flat; explicittype/flatconfig values stay honoredDirectoryNodeon the additiveBrowserState.tree; sidebar folder rendering withdir:+ relpath data keys (posix-pinned), recursive expansion snapshot, O(1) node mapyruns the right Core service (write_importvscreate_artifact); the confirm-write modal is untouchedStatsState(section → lines) built synchronously in the adapter; theStatsViewowns the collection worker, mirroring the import view's patternnewandstats(15 commands); statusline hints for the stats regionExcluded
rac initfrom the Explorer — initialization stays a one-time CLI step;/newpoints at it when missingProduct / Architecture Decisions
PurePath(relpath).as_posix()) so expansion state is stable across platformsrender_artifact, no writes, no ID) with an explicit "(ID assigned on write)" note — preview and write can never disagree about who mints identitycreate_artifact's six failure modes each translate to a one-line recoverable message; the refusal paths verifiably write nothing/browsechanges shipped as one commit (removingfocus_groupwould break the route mid-sequence);/newand/statslikewise share one commit because they interleave in the same five files/statsinvocation in an exclusive worker; the view shows a collecting line meanwhileUser-Facing Contract
CLI
No CLI command surface changes. Entry point remains
rac explorer [directory].Human Output (Explorer)
decisions/,roadmaps/… nested exactly as on disk, counts beside each directory;/settingscyclesfolders|type|flat/new decision rac/decisions/adr-xyz.md→ template preview →y→ "Created … (ID RAC-…)" → the artifact opens; refusals explain themselves and write nothing/stats→ Portfolio Statistics with Overview, Requirements & Quality, Decisions, and Relationships sections/browse decisionrenders in the results panel (filterable withf) in every modeJSON Output
None —
explorer.jsonschema unchanged; the new grouping default applies only when the key is absent or unknown.Exit Codes
Unchanged.
Verification
Ran
tests/test_ingest.pyexclusion is the known containercryptographyissue, unrelated to this diff.Covered
roadmaps/v1/tree, expansion/cursor acrossrand watcher reloads, nested/openreveal, directory rows neither opening nor editing, the three-value settings cycle, the 1,200-artifact eager buildrac init-ed repo (file exists, frontmatter carries the mintedRAC-ID, the context view opens it, the sidebar contains it); refusals — existing target, missing directory, uninitialized repo, unknown type — each write nothingrac stats' own test corpus); the view renders, scrolls, and Esc returns/browsein folders and type modes; bare/newtype listing with usage; the registry contract re-pinned for v0.8.10 (15 commands)Review Path
src/rac/explorer/adapter.py—_directory_tree,new_preview/write_new,stats_state,type_rowssrc/rac/explorer/widgets/views.py— the generalized write workflow (ImportView),StatsView,ArtifactCreatedsrc/rac/explorer/widgets/sidebar.py— folder rendering, expansion snapshot, node map, revealsrc/rac/explorer/screens/main.py—/new//stats//browserouting, reload-then-opensrc/rac/explorer/preferences.py,state.py,commands.py,statusline.py— defaults,DirectoryNode/StatsState, registry, hintsdocs/cli.md, the design artifacts,CHANGELOG.md, the roadmap contract,docs/images/Notes For Reviewer
/newand/statsas excluded follow-ups; they're inImplementation Process
Implemented with AI assistance under the roadmap contract. Final scope, review, and acceptance decisions were made by the maintainer.