Skip to content

D21: the repository lens — one widget, two vocabularies, and a drill-in - #104

Merged
brettheap merged 1 commit into
mainfrom
change/repository-lens
Aug 7, 2026
Merged

brettheap merged 1 commit into
mainfrom
change/repository-lens

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

Realizes Brett's observation that the repository filter and the keyword lens are the same mechanism, plus the three realization choices he made: the switch lives in the Lens tab, the filter keeps its own quick control with the lens as the deep view, and the drill-in is a scoped view with no new persistence.

The insight, made structural

buildLensModel reads a snapshot in exactly two places — the vocabulary with counts, and which terms a document carries. Everything downstream is vocabulary-agnostic. So repositoryVocabulary() re-expresses a composed snapshot in the lens's own shape (terms = member repositories, "documents" = cross-repository document IDENTITIES) and the entire widget serves the repository plane with no engine change: rings, sectors, dots, label-collision geometry, co-occurrence hints, and bullseye.js itself.

Rings become carrier counts, which also names the filter's modes in the lens's vocabulary: union is ring 1 and inward, shared is ring 2 and inward, and the old strict intersection was the centre.

What ships

  • Vocabulary switch in the Lens tab, offered only on a composed view. The keyword lens is untouched in behaviour and appearance.
  • The rail's ticks ARE the visible set: the lens opens on it and writes through, so the filter popover and the lens never disagree; it redraws locally rather than reloading, because it holds the whole aggregate (app.js hands the lens the unnarrowed snapshot on purpose — the narrowed one could only shrink further, never restore).
  • Drill-in: activating the centre or a sector — from the hit region or the labelled pane beside it — scopes the whole shell to that region's documents. The scope is a document set; every other plane keeps only what references it. A banner states documents, identities and the combination, and clears.

No contract growth: no schema, route, or gate verb. Saving a repository recipe (workbench manifest / add-as-cluster) is deliberately out of scope and would be a successor change with real gate-verb growth.

Two guards moved, both stating the new rule

  • The bullseye's activation-handler pin said "only the workbench wires a handler". D21 gives the repository vocabulary a real gesture, so the pin now asserts the gate: one call site, ctx.onDrill ? { onActivate: … } : undefined, with the handler existing only for the repository vocabulary — the keyword lens still passes no opts, so its regions stay inert.
  • The drill-scope storage now goes through guardedSessionStorage() (the blocked-site-data seam), which is what the doxbench transport guard was protecting.

Verification

  • Node tests over the REAL lens engine: the projection (rail counts, identities, carriers, real per-repository copies), rings as carrier counts, centre and sector targets, the narrowed-checked-set case, the non-composed null; and scoping (referencing planes only, unrelated planes untouched, null scope passes through).
  • Live browser check on the 14-repository plane, project domains: rail of 5 with identity counts, 219 identities on rings 5..1 (215/1/1/2), sectors naming real combinations including docs/credentialing.md under Ledgerx ∧ Ops ∧ codex; unticking redrew to 4 repos / 214 identities with no reload and moved the filter label to "⧩ 4 of 5 Repos"; centre drill-in scoped to 8 documents / 2 identities and clear restored. Zero console errors, page errors, >=400 responses.
  • Full suites 2770 passed, 19 skipped, exit 0. openspec validate --all --strict green.

Task 4.4 (Brett's first real drill-in session) stays open.

🤖 Generated with Claude Code

Brett's observation: 'our repo selector is now very similar to the lens
function but for documents in repos vs keywords in documents.' It is the
same mechanism, and the code proves it — buildLensModel reads a snapshot
in exactly two places (the vocabulary with counts; which terms a document
carries), so a projection serves the whole widget unchanged.

repositoryVocabulary() re-expresses a composed snapshot in the lens's own
shape: terms are member repositories, 'documents' are cross-repository
document IDENTITIES, and an identity carries a repository when that
repository has it. Rings therefore become CARRIER COUNTS, which also
names D19/D20 in the lens's vocabulary: union is ring 1 and inward,
shared is ring 2 and inward, strict intersection was the centre. The lens
engine, the bullseye geometry, the label-collision work and the
co-occurrence hints are all reused verbatim.

The Lens tab gains a keywords|repositories switch, offered only on a
composed view. The repository rail's ticks ARE the visible set: the lens
opens on it and writes through, so the filter and the lens never
disagree, redrawing locally because it holds the whole aggregate.

Activating the bullseye's centre or a sector — from the region or from
the labelled drill-in pane beside it — scopes the whole shell to that
region's documents. The scope is a DOCUMENT SET; every other plane keeps
only what references it. A banner states documents, identities and the
combination, and clears.

No contract growth: pure view derivations over data the composition
already carries. Two guards moved and say why: the bullseye's
activation-handler pin now states the vocabulary gate (the keyword lens
still passes no opts), and the drill-scope storage goes through
guardedSessionStorage. Suites 2770 passed (exit 0); strict validation
green; live-checked across the whole gesture set.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 7, 2026 16:27
@brettheap
brettheap merged commit bf8957f into main Aug 7, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @brettheap! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a “repository vocabulary” mode for the existing Lens widget on composed (multi-repo) snapshots, reusing the same lens engine/geometry to visualize repository membership as terms and cross-repo document identities as dots, and adds a drill-in gesture that scopes the whole dashboard to a selected bullseye region.

Changes:

  • Add repositoryVocabulary(), identitiesFor(), and scopedSnapshot() to adapt composed snapshots into the lens’s existing input shape and to support drill-in scoping.
  • Extend the Lens tab UI with a vocabulary switch (keywords ↔ repositories), repository-aware copy/labels, and a drill-in pane + bullseye activation handler gated to the repository vocabulary.
  • Wire drill-in scope storage + banner into the app shell and add Node-driven tests covering the new projection and scoping behavior.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/ideation-dashboard/test_project_aggregates.py Adds Node harness assertions for repository-vocabulary projection, ring semantics, identities targeting, and scoping behavior.
tests/ideation-dashboard/test_bullseye_widget.py Updates the “activation handler” guard test to assert the new repository-only wiring condition.
scripts/ideation_dashboard/web/views/lens.js Implements vocabulary switching, repository-vocabulary rendering, drill-in pane, and repository-only activation wiring.
scripts/ideation_dashboard/web/views/composed-model.js Adds the repository vocabulary adapter, bullseye-region → identities targeting, and snapshot scoping by identity.
scripts/ideation_dashboard/web/styles.css Adds styles for the vocabulary switch, drill-in pane, and drill banner.
scripts/ideation_dashboard/web/index.html Adds the drill banner host element.
scripts/ideation_dashboard/web/app.js Stores/applies drill scope and passes new lens seams (unnarrowed composed snapshot, visible set, drill-in callbacks).
openspec/changes/add-repository-lens/tasks.md Tracks implementation tasks and verification status for the change.
openspec/changes/add-repository-lens/specs/ideation-dashboard/spec.md Captures the new requirements/scenarios for repository vocabulary and drill-in scoping.
openspec/changes/add-repository-lens/proposal.md Provides rationale and scope boundaries for the change.
ideation/staging/dashboard-project-scoping/dashboard-project-scoping.md Records the D21 decision/context and ties it to this change.
docs/ideation-dashboard-session-runbook.md Documents the new Lens tab repository vocabulary and drill-in behavior for operators.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 32 to +36
// design D1): this view and the staging workbench's lens panel consume the same
// widget, so the two surfaces cannot drift. This tab supplies no `onActivate`,
// so the rendered SVG is exactly what it was before the lift.
import { renderBullseye } from "./bullseye.js";
import { identitiesFor, isComposed, repositoryVocabulary } from "./composed-model.js";
Comment on lines +444 to +449
line.appendChild(el("span", "n", row.documents.length + " doc"
+ (row.documents.length === 1 ? "" : "s")));
const go = el("button", "cbtn", "drill in");
go.type = "button";
go.title = "scope the dashboard to these " + row.documents.length
+ " document" + (row.documents.length === 1 ? "" : "s");
Comment on lines +432 to +436
if (!rows.length) {
pane.appendChild(el("div", "drill-empty",
"No " + ctx.vocab.term + " is visible — tick one to draw the bullseye."));
return pane;
}
Comment on lines +637 to +639
if (vocab.id === "repositories" && options.onVisible) {
options.onVisible([...state.checked]);
}
Comment on lines +777 to +782
rawSnapshot, visible: view ? view.visible : null,
onVisible: (repositories) => {
if (!composed) return;
storeViewState(rawSnapshot.repository,
{ visible: repositories, mode: view.mode });
},
@brettheap
brettheap deleted the change/repository-lens branch August 21, 2026 23:57
brettheap added a commit that referenced this pull request Nov 23, 2026
…tirement-accounting

Brett Heap ratified #1365 at 89dbe6e with #104 at ea7a46206413 for source acceptance only, authorized ordered landing when green, then isolated P07 continuation.

All required runnable checks pass at the exact head and local nine-role Codex review is clear. The author and authenticated actor are both brettheap; the standing self-authored-PR approval exception permits bypassing only missing human approval. No checks, rules or source bytes are changed.

Main added only the independently landed #1366 exact QA receipt registration/test, with no overlap in this candidate. Local merge-tree verifies the combined tree before landing; separate post-merge CI remains required evidence.

Factory lands before wallet #104. Setup/dispatch unauthorized; feedback deferred; blocked writes unreplayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants