docs(arch): 2026-06-28 architecture analysis (Architect-Ready)#23
Conversation
…026-06-06 analysis Architect-Ready (Option C) analysis of src/legis (~16.5K LOC) via 8-cluster parallel review + validation gate: discovery, subsystem catalog, C4 diagrams, final report, code-quality assessment, architect handover. Conclusion: governance correctness is sound (no live false-green found); the debt is structural (mcp.py/install.py god-modules, a few layering-inversion coupling edges). Removes the prior 2026-06-06 analysis this supersedes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6126f1fe9b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - A pre-existing, unrelated dirty working-tree state exists under `docs/arch-analysis-2026-06-06-0158/` (a June-6 analysis showing deleted-but-tracked files). Left untouched; out of scope. | ||
| - All analysis artifacts are kept **untracked** (not committed) so nothing pollutes open PR #22 (the security fix) or PR #21 (the release). |
There was a problem hiding this comment.
Stop claiming committed artifacts are untracked
In this commit the June 6 analysis directory is actually deleted and the new docs/arch-analysis-2026-06-28-2142/ files are added to git, so these scope notes now describe the opposite of the repository state. After this lands, readers will believe the old tracked artifacts were left untouched and the new analysis was not committed, which makes the architecture handoff unreliable and obscures the real doc churn in this PR.
Useful? React with 👍 / 👎.
| > Findings from the 8 reviewers, **after validation** (`temp/validation-catalog.md`). Severity is by Legis's own yardstick: a real high-severity issue is a **false-green / fail-open** risk; documented fail-closed residuals are not defects. Each item cites evidence and, where relevant, an existing tracker ID. | ||
|
|
||
| ## Governance-honesty posture — strong | ||
| No live false-green or fail-open path surfaced across 16.5K LOC / 8 independent reviews. The composition root fails closed (mcp.py:194-200), sign-off binding fails closed on non-SEI keys and on split-state (signoff_binding.py:46-50, 71-81), the audit chain is HMAC-signed with v3 chain binding, and the self-hosted policy-boundary gate prevents vacuous PASS. **This is the product's core promise and the code keeps it.** |
There was a problem hiding this comment.
Preserve the known open honesty defects
The repo's current planning docs still list three confirmed open P2 governance-honesty defects (legis-476ab6f125, legis-0c310712a7, legis-0186c23a2c), and this analysis does not mention the latter two at all. If this handoff is used for planning, the blanket "No live false-green" / "code keeps it" statement incorrectly makes the north-star security backlog look complete; please qualify this as no additional issues found by this pass or carry the known open defects into the assessment.
Useful? React with 👍 / 👎.
| - **H-11 (D2): Keychain custody adapter.** Implement `_keychain_available()` + a live keychain `key_sink`; the fail-closed fallback already protects users until then. | ||
|
|
||
| ## Tracked items — link, don't duplicate | ||
| - **F1 / legis-e5e5b0b57f** (derive protected-record verification from config/identity, not in-record fields) — already on the tracker; the modify-to-unsigned residual. Not re-filed here. |
There was a problem hiding this comment.
Link a real tracker before suppressing F1
Within the repo, legis-e5e5b0b57f only appears in this new analysis directory, while the product tracker docs enumerate other active tracker IDs and omit this one. In that context, telling architects this TrailVerifier residual is "already on the tracker" and "Not re-filed" can leave the issue with no actionable backlog item; please replace it with an existing tracker/reference or mark it as something to file.
Useful? React with 👍 / 👎.
| - Outbound: `service/governance`, `service/wardline`, `service/explain`, `service/preflight`; `enforcement/` (engine, protected gate, signoff gate, trail verifier); `store/audit_store`; `policy/cells`, `policy/grammar`; `identity/resolver`; `filigree/client`; `governance/binding_ledger`; `posture/floor`, `posture/ledger`; `git/surface`; `checks/surface`; `pulls/surface`; `wardline/ingest`; `warpline_preflight/client`; `doctor`, `install`, `hooks` (via `cli.py` best-effort refresh on boot) | ||
|
|
||
| **Patterns Observed:** | ||
| - Strict thin-adapter discipline: every tool handler calls a `service/` function and maps the result to the MCP envelope; no governance decision logic is in `mcp.py` itself |
There was a problem hiding this comment.
Stop saying every MCP handler uses service
Several MCP handlers bypass service/ entirely, so this pattern claim is too strong for the architecture handoff. For example, _tool_check_report constructs and records a CheckRun directly via _checks(runtime).record(...), git tools call _git(runtime) directly, and policy_boundary_check runs scan_policy_boundaries in mcp.py; presenting every handler as service-mediated hides exactly where adapter-local behavior and defects can live.
Useful? React with 👍 / 👎.
Summary
Architecture analysis of Legis (
src/legis/, ~16.5K LOC) produced via the system-archaeologist workflow — 8-cluster parallel review + a validation gate (Architect-Ready / Option C).Adds
docs/arch-analysis-2026-06-28-2142/: coordination plan, discovery findings, subsystem catalog (8 reviewers, file:line-cited), C4 diagrams, final report, code-quality assessment, and an architect handover backlog. Removes the supersededdocs/arch-analysis-2026-06-06-0158/analysis.Conclusion
service/truth layer" design is real and measured; the composition root and audit/sign-off seams fail closed.mcp.py,install.py) and a few layering-inversion coupling edges (store↔enforcement,policy→service,posture→install,api→mcp). Prioritized refactor backlog in06-architect-handover.md.main-checkout artifact, deliberate fail-closed stubs, a fenced dev default, a documented fail-closed trade-off).Docs-only change; no source or test files touched.
🤖 Generated with Claude Code