Orchestrata Ultimate › Plans › system-analysis-2026-08-23

Orchestrata system analysis — 2026-08-23

Source: plans/system-analysis-2026-08-23.md at 8a2cb42ad · last changed 2026-08-23 · first committed 2026-08-23 · 279 lines.

Prose pending.

Plan text

Orchestrata system analysis — 2026-08-23

Method. Six analyst swarms (Specs & Requirements, Code & Architecture, Tests & Verification, Docs & Knowledge, Enforcement & Gates, Runtime & Deployment). Five lenses per domain, 30 workers, one Opus coordinator per domain charged with independently re-verifying every FATAL/MAJOR before promoting it, then cross-domain consolidation and a completeness critic. 38 agents, 0 errors, 2,710 tool calls, 105 minutes. All read-only; output standardised by validated schema at all three layers.

Verdict: FAILING. All six domains returned FAILING independently.

§7 records the corrections the critic forced. Read it before acting on §4 — one FATAL is false and one prescribed fix is a no-op.


1. The one-sentence finding

The deployed bytes are correct; the layer that keeps the system honest is not.

PROD is git-clean at 143310ec (= origin/master), 11 of 11 installed unit files are byte-identical to version control, and 5 of 5 daemons run the prod venv under the free-threaded interpreter with 0 restarts. Against that, the enforcement layer cannot fail: neither live pre-commit gate can block a commit, the 23-gate battery has no automatic trigger, 19 declared pre-commit hooks execute 0 times, and the designated status reader prints "No red finding" against a cache recording two failures.


2. Systemic patterns — the highest-value output

Defect shapes recurring across domains. Each names the mechanism that permits it, not the incidents.

# pattern domains
1 The oracle that cannot fail — a verdict derived from a field the producer never writes, an exit code the checker cannot set, or a stream the parser cannot read 6
2 Registration mistaken for wiring — the artifact exists, is executable, is deployed, is named in a manifest, and nothing invokes it 6
3 The scope-narrowing default — a checker whose default argument excludes the root where the violations live, reporting a ratio whose denominator came from what it chose to look at 6
4 Fork-then-diverge — one capability, two implementations, every path-keyed reference bound to whichever copy the author had open 5
5 Two authorities, no supersession path — the correcting decision is recorded where the reader of the wrong document cannot see it 5
6 Bare python/python3 in an invocation string — the verdict is decided by PATH, and the resulting ModuleNotFoundError is swallowed 4
7 Fail-open by default in the guard layer — a guard that cannot evaluate its input allows, and the allow is indistinguishable from a real pass 4
8 Hand-maintained inventory beside a generated one — no mechanical link, no completeness check, so every new gate/spec/package silently widens the gap 4

Why #1 recurs, stated precisely: nothing in this project requires a checker to demonstrate it CAN fail. No negative-corpus requirement, no mutation step, no falsifiability assertion at authoring time — and producer and consumer of a verdict live in separate files that duplicate key names as string literals with no shared schema. error_report.py:201 reads body["status"]/body["verdict"] while gates.py::_save_cache writes exactly {fingerprint, ok}; the key union across all 24 cache entries is ['fingerprint','ok'].

Why #2 recurs: the meta-check that grades whether rulings are mechanised is built on the same substitution it should catch. scripts/rulings_lint.py:163-171 defines a verified gate as "the script file exists AND the rule-id appears as a substring anywhere in its text"; :147-151 defines a verified hook as "the file exists and is executable". Neither predicate is invocation. It reports 31/31 green while 6 rulings (RUL-012, 013, 016, 018, 020, 031) have no automatic enforcement anywhere.


3. Domain verdicts

domain verdict headline
Specs & Requirements FAILING Five readers disagree on what the requirement corpus is — 5,560 / 5,584 / 7,256 / 7,336 / 5,143 ids
Code & Architecture FAILING 0 of 23 gates compares implementations for duplication or divergence
Tests & Verification FAILING 1,074 of 33,259 collected tests (3.23%) cannot fail on any behavioural defect — proven by execution
Docs & Knowledge FAILING doc_lint executes in zero automated contexts and returns 0 FAIL on the three always-loaded files
Enforcement & Gates FAILING Neither live pre-commit review gate can block a commit; one has never executed at all
Runtime & Deployment FAILING Deployed bytes are correct; every mechanism that would detect them going wrong is not running

4. Top findings

Severity per dossier §7. See §7 for corrections — TOP-06 does not survive.

id sev finding
TOP-01 FATAL Both live pre-commit review gates fail open. core.hooksPath=scripts/hooks, so scripts/hooks/pre-commit is live: its code-review branch pipes banner-prefixed stdout into json.load with || echo 0; its test-review branch passes --format, an argument scripts/test-review.py does not define (0 occurrences), so it exits 2 before running
TOP-02 FATAL The enforcement layer has no automatic trigger. 19 declared pre-commit hooks execute 0 times (core.hooksPath shadows them, nothing runs pre-commit run); scripts/gates.py is invoked by no hook, CI stage or ship stage — 12 gates have no other runner; .github/workflows/ci.yml holds 8 further checks and cannot run on a GitLab-only remote
TOP-03 FATAL 1,074 of 33,259 collected tests cannot fail: all generated *_smoke tests contain zero asserts and wrap constructor and call in except Exception: return. Sabotaging all 14 PluginSDK methods to raise produced 0 failures. Prescribed fix is a no-op — see §7.2
TOP-04 FATAL All 25 project PreToolUse/Stop guards did not fire in a delegated agent session; a command the guard demonstrably denies ran RC=0. Mechanism not established — see §7.3
TOP-05 FATAL scripts/error_report.py exits 0 printing "No red finding" against a cache recording mypy=false and plugin-drift=false, because it reads keys the producer never writes
TOP-06 FATAL FALSE AS STATED — demoted to risk. See §7.1
TOP-07 FATAL 7 of 8 production units gate every start on /home/mohamed/.local/bin/orchestrata-kg-ready — tracked in no repository, shebang #!/home/mohamed/workspace/orchestrata-ultimate-architecture/.venv/bin/python. Production start depends on the DEV checkout's interpreter
TOP-08 FATAL The always-loaded instruction tier is false three ways: gRPC asserted 36 times for a transport that raises ValueError (all profiles pin cxpt, import grpc fails in the venv); a different git repository named as the edit target; 10 documented session subcommands that all exit 2
TOP-09 FATAL SPEC-020's "never deleted" audit trail: 0 registered writers, 0 existing sinks, against a 240/240 checked requirements checklist. ~/.claude/audit/ returns ENOENT
TOP-10 FATAL gates.py --only <unknown> runs zero gates and prints ALL GATES PASS — :527 filters with no name validation and the banner at :571-573 sits outside if to_run:
TOP-11 FATAL claude/tools/claude_turn_capture.py:101-102 defaults REDIS_HOST to localhost — RUL-003 violated in a live production hook, registered twice on each of two surfaces
TOP-12 FATAL SPEC-007 (P0, Complete) specifies an 11-article ENGINEERING constitution with zero name overlap with the 12 ETHICS articles constitutional.pl actually defines and intent_policy.pl enforces
TOP-13 MAJOR RUL-027 prod-separation gate has four blind spots and reports PASS: DEFAULT_GLOB='orchestrata-*.service' covers 7 of 20 installed units; exactly 2 units carry the dev-tree literal and both are outside the glob
TOP-14 MAJOR Generated-artifacts gate prints "generator provenance satisfied" over a tracked artifact whose generator was deleted in e73df607
TOP-15 MAJOR No authoritative full-suite run exists at HEAD. reports/run-tests-latest.json records a non-authoritative subset: 389 passed over 16 modules against head_commit=eba191d1 while HEAD is 143310ec

5. What is healthy — claims attacked that survived

13 recorded. The substantive ones:


6. Cross-domain contradictions

10 recorded; the coordinators resolved 7 by measurement. Three remain UNRESOLVED and each changes a remediation decision:

  1. Do the 25 project PreToolUse guards fire in a MAIN interactive session? Inertness was measured only inside a delegated subagent (CLAUDE_CODE_CHILD_SESSION=1). If they fire normally in main sessions, TOP-04 is a subagent-scoping bug, not a dead enforcement layer.
  2. Is ~/.claude/settings.hooks.json read by Claude Code at all? The claude 2.1.241 binary contains zero occurrences of that filename and multiple of settings.local.json.
  3. Did ~/.claude/audit/ ever exist? This decides whether SPEC-020's audit trail is "built then disconnected" (a wiring fix) or "specified, never built" (a build).

7. Corrections the completeness critic forced

The critic's job was to attack this analysis. It succeeded four times. Each below was independently re-verified before being recorded here.

7.1 TOP-06 is FALSE as stated — and it was ranked step 1

Claim: the deployed session CLI destroys goal.current_step and portfolio_goals on every write, "the only finding in the system where data is being destroyed continuously."

Measured against the live 449,585-byte context.json:

grep -c current_step    context.json  -> 0
grep -c portfolio_goals context.json  -> 0

Neither field is present anywhere in the document. Nothing is being destroyed. The round-trip proof ran against a state the analyst seeded, then was converted into an ongoing-loss claim and placed ahead of the interpreter pinning that gates every other measurement.

The divergence is real — src can populate both fields (session/controller/_goals.py:83,261,280; models.py:184) and the fork's pydantic extra='ignore' would drop them. Correct class: risk, not FATAL data loss.

7.2 TOP-03's prescribed fix is a no-op — the report committed its own pattern #4

TOP-03 prescribes editing scripts/generate_pytest.py:1387-1441. Rendering reads templates/smoke_test.jinja2 from disk (:1650 → FileSystemLoader(self.template_dir)), and :1490-1491 skips the write-back because the file exists and is git-tracked. The inline literal and the on-disk template are byte-identical today (both 4,004 chars) — but only the on-disk copy is ever read. Editing the prescribed lines changes nothing.

templates/ is one of the directories no swarm opened.

7.3 Claims asserted without measurement

7.4 The read-only mandate was breached by side effect

Files written into the tree during the run: 11 artifacts under reviews/ (08:25–09:58), .cache/gates.json (09:33), .coverage (09:26), and plans/ast-*.json (09:16:25–09:16:36).

reviews/ is gitignored, so a git status check reports "repo untouched" — that check is itself an oracle that cannot fail, and it was mine.

The AST rewrite matters most: orchestrata-ast-live-sync.service is active and regenerated the snapshots mid-analysis. Every AST-derived figure in this report — 868 src modules, 2,273 import edges, 167 zero-importer modules, 3,015 files scanned — was read from an uncommitted, moving artifact that the dossier independently flags as carrying corrupt dependency edges. No domain recorded a hash or timestamp.

7.5 Structural criticisms accepted


8. Surfaces no swarm examined

Tracked, and absent from all six domain reports:

path files why it matters
templates/ 4 holds the live jinja2 templates — invalidates TOP-03's fix (§7.2)
rtm/ 81 a sixth and seventh RTM authority, in the domain whose verdict is "five readers disagree"
architecture/ 30 the rest of the standard whose violation count is a headline
secrets/env.sops.env 1 a git-hook-driven mechanism, in a system whose thesis is that git hooks do not fire
backups/ 8.9 GB untracked the payload orchgraph-backup.service writes into the dev tree
schema/ast-ultimate.schema.json 1 the declared schema for the artifact every reachability number rests on — never validated against it
vendor/wheels/ 4 cp314t free-threaded supply chain; GIL re-enablement probed only for the 5 daemons, not for gate or pytest processes
claude-env/ 3 a second installer, in a domain whose verdict turns on installers
tasks/, typings/, configs/, design/, research/, arch-canvas/, tools/, prolog/multiagent.pl 57+ unopened

Also unexamined: reviews/ (2,372 gitignored files, an active write sink), uv.lock, GitLab pipeline history, and both knowledge graphs — neither was queried by any domain.

One security check the critic did run: secrets/env.sops.env holds 26 ENC[ values and 11 plaintext keys including MEMGRAPH_PASSWORD; all three plaintext credential values measured len=0. No leak. But scripts/check_secret_leaks.py:99 allowlists that file and no domain ran it.


Ordered by dependency, not severity — a fix that makes another verifiable comes first. Corrected for §7.

# action unblocks
0 Re-run the analysis' own AST-derived numbers against a pinned snapshot — stop the live-sync daemon or record a hash first every reachability figure in §4
1 Pin the interpreter in every invocation string — scripts/hooks/* (6 bare python), health_check.py:79,:298, .claude/hooks/* everything: no gate, hook or documented command is a measurement until PATH stops deciding the verdict
2 De-fail-open the two live pre-commit gates — send code-review.py:1153's banner to stderr; add a JSON emitter to test-review.py or drop the unsupported --format there is no point wiring more enforcement while the enforcement that IS wired is a constant PASS
3 Make the battery's verdict honest — reject unknown --only names with exit 2; scope the terminal banner inside if to_run:; make error_report.py read ok wiring a trigger to a battery that cannot distinguish "nothing ran" from "everything passed" propagates the lie
4 Give enforcement one automatic trigger — invoke scripts/gates.py from scripts/hooks/pre-push, and one CI on the remote that actually exists every "a gate catches this" claim below
5 Fix the smoke-test generator at templates/smoke_test.jinja2 (NOT the inline literal — §7.2), regenerate, and re-measure the collection count that TOP-03's denominator needs every coverage claim and every "the suite is green" sign-off
6 Widen every scope-narrowing default and make each checker print its denominator and exclusions — generate_rtm_evidence --src, RUL-027's glob, doc_lint DEFAULT_PATHS, test-purity's positional, who-imports steps 7-8: each fixes a violation currently invisible to its own gate
7 Fix the prod→dev couplings the widened RUL-027 now sees — version-control the kg-ready probe; move backups/ out of the dev tree a truthful RUL-027 green, and removes the mechanism by which a developer edit breaks production start
8 Add a scheduled drift check — a --verify timer deployed under /opt detection of the next drift without a human typing ship
9 Correct the always-loaded doc tier at its generators — gen_level0.py:165,:206, gen_codebase_map's kernel row correct behaviour for every future agent session
10 Collapse the live forks — session, claude_turn_capture, and the others named in pattern #4 single-source correctness for capabilities that answer differently depending on which copy ran
11 Resolve the two-authority contradictions — write the supersession records, reconcile SPEC-007's 11 ENGINEERING articles against constitutional.pl's 12 ETHICS articles trustworthy answers to "what did we decide"

Before step 5, settle the three unresolved contradictions in §6 — each changes what the correct fix is.