Fix composite transfer validation verdict#76
Conversation
|
Findings:
CI is green, and the composite-verdict shape/test coverage is otherwise strong, but the fail-open boundary needs to close before merge. |
Independent code review — high-effort, reconciled against HEAD
|
* docs(refs): fix pitfall numbering collision, make cross-refs self-describing, refresh phase-2 statuses, land plan docs - CLAUDE.md: the duplicate Pitfall #20 (Export-Only Destination) is renumbered #32; the referenced #20 (Failed Entity Loss) keeps its number (code comments cite it). Numbering note added: #8 retired, #20 out of sequence, and the rule that a pitfall citation is always number + short name so it means something to a human without a lookup. (AGENTS.md mirrored locally; it is gitignored.) - ENGINEERING_FAQ.md: every bare section-letter reference ("(same as §E)", "(§G)", ...) expanded to include the section name; "Pitfall #20" citation made self-describing. - Phase-2 plan docs: stale status lines corrected (PR-1 #73 and PR-2 #75 are MERGED, not in progress; #76 in review, its fluid-gate fix gated on LAB-A). - New: 2026-07-08-pr-3-protocol-wiring-plan.md — the approved PR-3 executor plan rescued from the session (it existed nowhere on disk). - Landed the empirical-test docs (backlog, suite design, LAB-A spec); the first-pass lab-coverage doc gets a SUPERSEDED banner (its #76 checklist predates the 3a47a58 remediation) and is kept as the method record. * docs(refs): make every pitfall citation self-describing (number + short name) Fixes the 15 pure-pointer citations ("(Pitfall #16)", "(see Pitfall #12)", "(Pitfall #19 in CLAUDE.md)") that the incoming lint:doc-refs guard flags — a citation must be readable in place without a lookup, per the CLAUDE.md numbering note. No content changes, names only. * feat(lint): doc-refs + allow-manifest guards (both CI-gated via npm run lint) lint:doc-refs — human-resolvable documentation cross-references: - duplicate-pitfall-number: CLAUDE.md defining "### N." twice (the original #20 collision sat unnoticed for months) goes red. - unknown-pitfall-ref: citing a number that does not exist in CLAUDE.md (renumber rot, the retired #8) goes red. - pure-pointer-citation: a parenthetical or "See ..." sentence whose entire content is the reference goes red — the number + short name rule, now mechanical (a fresh reader broke the written rule within 48h; rules humans break that fast need a machine). Scope: root *.md + docs/*.md (docs/superpowers/** excluded as frozen records) + plugin docs. lint:allow-manifest — every *:allow escape hatch on a DI lint must be enumerated in scripts/lint-allow-manifest.json with reason + approver; unlisted, stale, and count-drifted annotations all go red. Allows are escalations (memory: lint-allows-are-escalations); the manifest diff is the reviewable record. Baseline: the 3 audited pre-manifest allows. Teeth verified red-on-violation for all rules: 15 organic pure-pointer reds (fixed in the previous commit), injected Pitfall #99 red, injected duplicate "### 19." red, manifest unlisted/stale reds during path canonicalization. * feat(lint): commit-label guard — docs commits must not carry code (CI PR step) Third guard in the family. Enforces the audit-boundary rule mechanically: any commit labeled docs:/docs(...) in the PR range may touch only *.md files or docs/ paths. The rule is twice-paid (the original rider incident, then a recurrence in an agent lab-findings commit within days of the rule being restated in its brief). No escape hatch — a mixed change is always splittable. Runs as a dedicated PR step (checkout fetch-depth: 0); fails loudly if the base ref cannot be resolved, never silently passes. Teeth verified: injected docs-labeled .lua rider red, clean range green. * docs(ruling): BLACK-BOX DISCARD — destination disposition on single-gate failure (binding on #30) Discard always; bank the always-on forensic bundle first (dest scan + per-name diff + force-state snapshot + tick stamps, never debug-gated); source preserved; opt-in preserve_failed_destination for active hunts. Grounded in BELT-2 drift (a preserved surface smears positionally even fully locked) and payload+dest-state determinism. * docs(brief): single-gate rewrite agent brief (task #30) — exact frozen-world gate + Black-Box Discard The campaign converges here: fluid injection moves to the R11 seam position; ONE exact gate (items 0/0, fluids exact by-name at 1e-6) fed segment_temps; failed-entity-FLUID subtraction gap closed; dropped_fluids attributed; Black-Box Discard on failure (always-on bundle, then delete, opt-in preserve flag); post-activation fluid gate + quarantine fields retired; LossAnalysis writes a separate postActivationReport; two TS one-line hardenings; full test and doc blast radius from the impact map. Supersedes the ON-HOLD 2026-07-09 brief. * Revert "docs(brief): single-gate rewrite agent brief (task #30) — exact frozen-world gate + Black-Box Discard" This reverts commit 3d3b72d. * Revert "docs(ruling): BLACK-BOX DISCARD — destination disposition on single-gate failure (binding on #30)" This reverts commit 8dd4837.
… fixtures + clone allowlist (#79) Owner-approved plan: New-BarePlatform + New-KnownContentPlatform in TestBase.psm1 (patterns lifted from the labs and destination-hold), shared lab-helpers.mjs (dedup the 25-copy rcon/mk/cleanupAll trio), migrate exactly 9 clone-wasting tests (~12-18 min/run saved vs a 15-min CI timeout), and a SCALE_FIDELITY_TESTS allowlist rule in lint:test-grounding so the big clone becomes a reviewable act. Queued AFTER PR #76 merges (tests re-baseline there).
Summary
success.failedStage=fluids, and make the final debug import-result match the controller verdict.failure_stagemetrics, UI failure-stage display, docs, static teeth, and a focused live probe for post-activation fluid loss./di-change checklist
tests/integration/fluid-gate-detects-lossinjects a measured post-activation fluid shortfall through a debug-gated, one-shot hook and asserts source preserved + destination discarded.test_force_fluid_lossis debug-gated, consumed once, non-destructive to the destination state itself, and listed inlint:test-hooksas a pre-gate fail-safe hook.Red-to-green tooth
TransferValidation.validate_fluids_post_activation(result)and patch/reset the cluster.node tools/run-integration-tests.mjs --only 'fluid-gate-detects-loss'failed as expected: 1/6 passed; verdict stayedvalidation_success=True,failedStage=items,fluidCountMatch=True; source was deleted and destination remained.Verification
node --test test/composite-transfer-verdict.test.cjs— pass 6/6npm run lint:lua— passnpm run lint:test-hooks— pass, 19 tests / 4 hooksnpm run lint:test-grounding— pass, 19 testsnpm run lint:pcall-logging— passnpm run lint:web-cache— passgit diff --cached --check— passnode tools/run-integration-tests.mjs --only 'fluid-gate-detects-loss|gate-detects-loss|transfer-fidelity|rollback|engine-invariants|platform-roundtrip'— pass 6/6docker exec surface-export-host-1 sh -c 'cd /clusterio/external_plugins/surface_export && npm test'— pass 153, skipped 11, failed 0Notes
0.10.75.