feat: add architecture workspace prototype - #1817
Draft
simple-agent-manager[bot] wants to merge 27 commits into
Draft
feat: add architecture workspace prototype#1817simple-agent-manager[bot] wants to merge 27 commits into
simple-agent-manager[bot] wants to merge 27 commits into
Conversation
Contributor
simple-agent-manager
Bot
force-pushed
the
sam/architecture-workspace-prototype
branch
from
August 14, 2026 06:42
31830eb to
96c102a
Compare
… lacks
The Topology lens presented three claims the data never supported:
1. rankLabel() hardcoded rank 0 as "Entry", rank 1 as "Runtime" and 2+ as
"Hop N". These are domain roles invented by the view — a rank-1 node is
not a runtime. Bands are now labelled from graph position only
("Sources", "Depth N") and the header states what the bands mean.
2. packDenseColumns() split any rank wider than the wrap limit into
"Entry.1 / Entry.2 / Entry.3", so pagination rendered as architectural
tiers. With 36 unconnected elements the viewer showed three confident
"ENTRY" columns that were really pages 1-3 of one list. A rank that
wraps is now one band with one label spanning its lines, and a scope
with no routes says so instead of inventing depth.
3. createVerticalTopologyLayout() (mobile) never read relationships at
all. It stacked elements in document order under a lane called "Stack"
and drew edges between arbitrary neighbours, so mobile topology was not
a topology. Both orientations now share one ranking pass.
Elements with no in-scope routes are separated into an "Unconnected" band
rather than folded into depth 1, which is a finding rather than a stage.
Also removes decoration that was standing in for information: the header
collapses to a single-line command bar (~60px of canvas reclaimed on
mobile), inspector sections with nothing to report are omitted instead of
rendering a heading over "None.", and the minimap is hidden below 8 nodes.
Lens counts are labelled "Scope nodes"/"Scope routes" and the status bar
"workspace" — the two were showing different numbers under identical
labels. The topology summary is now sticky so the band legend cannot pan
out of view.
Tests: 9 new cases in tests/topology-layout.test.ts. Five were verified to
fail against the previous implementation before being relied upon.
75 package tests and 6 Playwright scenarios pass at 1280/375/320px.
Co-Authored-By: Claude <noreply@anthropic.com>
30 tasks
|
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
packages/architecture, an extractable TypeScript package for compiling, validating, querying, and serving a repository-native architecture workspace.architecture/model for SAM with 19 elements, 21 relationships, three views, CLI login and session-startup flows, and the TaskRunner lifecycle state machine.Validation
pnpm lintpnpm typecheckpnpm test.claude/rules/47-control-loop-io-budget.md)Additional validation:
pnpm build,pnpm format:check,git diff --check, andpnpm quality:file-sizespassed.packages/architecturepassed 66 unit/integration tests with 89.8% line and 71.57% branch coverage.architecture:inbox, answered througharchitecture:reply, and appeared in the still-open desktop/mobile browser through watcher/SSE with zero browser errors.pnpm architecture:validate, summary, show, inbox, and impact commands passed. Summary compiled 19 elements, 21 relationships, three flows, one state machine, and three views.76cac95aef9edcf3d8c12966d940cc461f0b9011passed the full local repository gate,pnpm check:fast,pnpm quality:file-sizes, andpnpm architecture:validate. Fresh CI run 31777620116 passed, including the 8m29s coverage Test job and 8m45s Durable Object Workers job.Staging Verification (REQUIRED for all code changes — merge-blocking)
Deploy Stagingworkflow triggered manually and passed for this branchapp.sammy.party(staging) using test credentials and actively tested the applicationStaging Verification Evidence
d44c8ebc6b0fd1dd39a1e1191ff6c007127c0c06. Validate Configuration, Cloudflare deployment, workflow health check, and all 12 smoke tests passed. Newer commits contain task/supply-chain evidence, a CI test timeout adjustment, and package-only Sonar/deterministic-ordering fixes; no deployed API, web, or infrastructure path changed.https://api.sammy.party/health, the loaded dashboard and project cards, click-through to a real project chat, loaded cloud-provider settings, and zero console or uncaught page errors. Screenshots:.codex/tmp/playwright-screenshots/architecture-regression-{dashboard,project,settings}.png.pnpm quality:observability-noiseexited successfully.OBSERVABILITY_DB_IDwas absent and the Workers telemetry endpoint returned 403, so those optional probes were explicitly skipped.UI Compliance Checklist (Required for UI changes)
.codex/tmp/playwright-screenshots/(see.claude/rules/17-ui-visual-testing.md)The package viewer is extraction-oriented and owns its intentionally self-contained CSS/component surface; it does not import SAM app UI packages. Keyboard-accessible relationship lists complement canvas edges, and the mobile inspector implements initial focus, Tab/Shift+Tab wrapping, outside-focus containment, Escape/close behavior, and focus return.
End-to-End Verification (Required for multi-component changes)
.claude/rules/10-e2e-verification.md)Data Flow Trace
packages/architecture/src/client/Inspector.tsx:useQuestionCreatorsends a selected target and question throughpackages/architecture/src/client/api.ts:createApiClienttoPOST /api/threads.packages/architecture/src/server.ts:handleCreateThreadvalidates the strict bounded payload and callspackages/architecture/src/threads.ts:createThread.createThreadvalidates the target/content, rejects reserved message delimiters, confines the thread path, and writes atomically throughatomicWriteNewFile.packages/architecture/src/server/workspace-state.tsobserves workspace/thread changes;packages/architecture/src/server/events.tspublishes the SSE update;packages/architecture/src/client/useArchitectureViewer.ts:reloadAfterSsereloads while retaining the last valid view state.Inspector.tsx:useThreadReply→api.ts→server.ts:handleReply→threads.ts:appendThreadReply, with library and real HTTP tests proving the resulting file mutation and recompiled model.Inspector.tsx:useSourceLoader→POST /api/source-preview→server.ts:handleSource→source.ts:readSourceReference, which enforces repository confinement, symlink safety, byte/line limits, and validated source ranges.cli.ts:runCli→loader.ts:loadArchitectureWorkspace→compiler.ts:compileWorkspace→ bounded functions inqueries.ts; distribution tests exercise the built ESM/CLI output rather than source-only imports.Untested Gaps
Post-Mortem (Required for bug fix PRs)
N/A: not a bug fix. This PR adds a new package, checked-in workspace, local viewer, and maintenance workflow.
Specialist Review Evidence (Required for agent-authored PRs)
needs-human-reviewlabel added and merge deferred to human — N/A: every reviewer completed.Exceptions (If any)
Agent Preflight (Required)
Classification
External References
Official/project documentation and prior-art behavior were researched before implementation: C4's semantic abstraction approach; LikeC4's multi-file model, views, source links, and queries; Rivière/Éclair's source-backed operational flows; Oh My Mermaid's filesystem watcher/SSE loop; Ilograph's hierarchy/sequence perspectives; and ArchUnit's validation/ratcheting model. No external API integration was added, so this is not classified as
external-api-change.Codebase Impact Analysis
Primary paths are
packages/architecture/for the extractable model/compiler/query/server/viewer package,architecture/for SAM-owned curated data, rootpackage.json/pnpm-workspace.yaml/pnpm-lock.yamlfor workspace commands and dependencies,.claude/rules/57-architecture-workspace.mdplusCLAUDE.md/AGENTS.mdfor agent maintenance policy, andapps/www/src/content/docs/docs/for architecture/local-development guidance. Existingapps/api,apps/web, and infrastructure runtime code are not modified.Documentation & Specs
Updated
packages/architecture/README.md,architecture/README.md,apps/www/src/content/docs/docs/architecture/overview.md,apps/www/src/content/docs/docs/guides/local-development.md,.claude/rules/57-architecture-workspace.md,CLAUDE.md,AGENTS.md, andtasks/active/2026-08-13-architecture-workspace-prototype.md.Constitution & Risk Check
Checked Principles III, VIII, IX, X, XI, and XIII. The package documents its public contract, keeps compact bounded agent queries, avoids SAM app imports, favors a small neutral model, makes server/query/UI limits configurable, and validates file, HTTP, source-preview, and mutation boundaries. Key risks addressed are path/symlink escape, unsafe local writes, oversized/unbounded payloads, marker/terminator injection, schema drift, visually attractive but semantically weak diagrams, and duplicated documentation. Curated intent remains authoritative; generated evidence cannot silently redefine the model.