Skip to content

Prove the M0 legacy/canonical isolation boundary (REQ-MIGRATION-004) #41

Closed

Description

@abogun-product

Goal

Provide bounded M0 evidence for REQ-MIGRATION-004: legacy and canonical runtime stocks remain separate, with no adapter/path sharing authoritative mutable stock or mirroring mutations bidirectionally.

Evidence

REQ-MIGRATION-003 is merged in PR #29. Current src/ contains only the TypeScript toolchain entry and four scaffolding areas; legacy C# remains in TradeCraftSimulation. REQ-MIGRATION-004 is FROZEN and depends only on REQ-MIGRATION-003. It has no coverage row/proving test yet. EXECUTION_ORDER requires completing MIGRATION-001..004 before the M0 Milestone Preview. The baseline pin is handled separately by #39 / #40; do not duplicate it. Issue #33 remains blocked on unchanged credentials and is not a dependency of this work.

Scope

One M0 architecture/invariant proof unit, not a new engine: inspect the actual production entry points and dependency boundaries, add a small focused automated isolation guard/test in src/ (and a test helper only if needed), document its exact M0 coverage and limits in docs/spec/MIGRATION_BOUNDARY.md or a narrow existing equivalent, and add a truthful REQ-MIGRATION-004 row to docs/spec/IMPLEMENTATION_STATUS.md. Keep current runtime behavior and existing scaffolding intact. Choose the smallest useful test that can demonstrate a real prohibited boundary crossing; do not claim future unimplemented systems have been proved correct.

Non-goals

No economics, new mutable WorldState, compatibility bridge, shared stock owner, bidirectional export, workflow/runbook/credential changes, broad lint framework, or Milestone Preview implementation. Do not freeze the canonical engine to remain empty forever; future M1 implementation must be possible within the isolated canonical runtime.

Acceptance criteria

  • Record observed evidence for both runtime entry points and the absence of a shared authoritative stock write/bridge in the current M0 implementation.
  • Add a named automated regression check for the actual isolation boundary, with a negative control proving the check rejects an intentionally introduced prohibited bridge/dependency (a contained test fixture is acceptable; never commit a live bridge).
  • Explain precisely what the test enforces and what remains a review/invariant obligation in later milestones; no overclaim that a text marker alone proves all future behavior.
  • No existing runtime behavior or invariant test is weakened; all existing tests remain green.
  • Both runtime verification suites and all required current-head CI checks pass.
  • Coverage row remains truthful before merge and references this Issue, the proving test and pending merge evidence.

Verification

Read the standard navigation files, then the exact Handoff/11 document and Non-negotiable migration rules anchor referenced by REQ-MIGRATION-004. Inspect only relevant runtime/config entry files to establish the boundary. Run the isolation test including its negative control, npm ci/typecheck/test/build and dotnet build/test Release. Hand off one scoped PR for independent ACCEPTOR review.

Activity

  1. added
    priority:highImportant and time-sensitive; schedule ahead of normal work
    type:architectureArchitecture, boundaries, contracts, or consequential design decisions
    area:simulation-coreTick loop, ordering, determinism, configuration
    status:readySpecified and unblocked; safe for an agent to claim
    on Sep 4, 2026
  2. drevendev commented on Sep 4, 2026

    @drevendev
    Owner

    AUTHOR claim

    • Role: AUTHOR
    • Scope: bounded M0 isolation-boundary proof for REQ-MIGRATION-004 — a focused automated regression check (with negative control) demonstrating legacy (C#/TradeCraftSimulation) and canonical (TypeScript/src) runtimes do not share an authoritative mutable stock or bridge, plus docs/spec/MIGRATION_BOUNDARY.md documenting the boundary and its limits, plus a truthful REQ-MIGRATION-004 row in docs/spec/IMPLEMENTATION_STATUS.md. No economics, no new mutable WorldState, no workflow/credential changes.
    • Also carrying in this same PR: the IMPLEMENTATION_STATUS.md reconciliation for REQ-MIGRATION-002 (per AUTHOR_RUNBOOK section 1) — PR Pin the expected seed-7/30-turn legacy baseline hash (REQ-MIGRATION-002) #40 merged at 6063ed9, closing Issue Pin the expected 30-turn legacy baseline hash for REQ-MIGRATION-002 #39, with proving test The_seed_7_thirty_turn_baseline_matches_the_frozen_expected_hash. Flipping that row from IN_PROGRESS to IMPLEMENTED.
    • Branch: claude/issue-41-migration-004-isolation
    • Known blocker: none yet.
  3. added
    status:in-progressClaimed work with an active branch or pull request
    status:needs-reviewImplementation complete, awaiting acceptance
    and removed
    status:readySpecified and unblocked; safe for an agent to claim
    status:in-progressClaimed work with an active branch or pull request
    on Sep 4, 2026
  4. drevendev commented on Sep 4, 2026

    @drevendev
    Owner

    AUTHOR handoff

    Decisions

    • Implemented the guard as a static, line-based textual scanner
      (src/diagnostics/isolationBoundary.ts) over src/**/*.ts and
      TradeCraftSimulation/**/*.cs, rather than an AST/module-resolution analysis —
      sufficient to catch a realistic M0 bridge (import path, File.Read, namespace
      reference) given the two runtimes cannot share memory in-process; documented as a
      known limit rather than claimed as complete, in docs/spec/MIGRATION_BOUNDARY.md.
    • The guard's own module/test files are excluded from the real-tree audit by basename
      match, since their fixtures/marker constants legitimately contain the forbidden text
      as data. Flagged as the highest-risk review area in the PR body.
    • Carried the AUTHOR_RUNBOOK.md section 1 reconciliation for REQ-MIGRATION-002 in the
      same PR (PR Pin the expected seed-7/30-turn legacy baseline hash (REQ-MIGRATION-002) #40 merged, closing Pin the expected 30-turn legacy baseline hash for REQ-MIGRATION-002 #39) rather than as a separate handoff, since it was
      a small, mechanical row update alongside this Issue's own work.

    Checks: npm ci/typecheck/test/build passed; dotnet restore/build/test
    passed (45/45, unchanged); policy_guard.py and scripts/tests passed. Full detail
    and evidence in the PR body.

    Remaining gate: none for this Issue's scope — handed off for independent ACCEPTOR
    review. status:needs-review set, replacing status:in-progress.

  5. added
    status:in-progressClaimed work with an active branch or pull request
    and removed
    status:needs-reviewImplementation complete, awaiting acceptance
    on Sep 4, 2026
  6. drevendev commented on Sep 4, 2026

    @drevendev
    Owner

    AUTHOR claim

    • Role: AUTHOR
    • Scope: address CHANGES_REQUESTED on PR Prove the M0 legacy/canonical isolation boundary (REQ-MIGRATION-004) #43 for REQ-MIGRATION-004. Both operator QA and the ACCEPTOR independently reproduced a real exclusion-bypass defect in excludingGuardModule (src/diagnostics/isolationBoundary.ts): substring matching on isolationBoundary lets any file whose path merely contains that text (e.g. src/domain/isolationBoundaryBridge.ts) silently escape the real-tree audit even when it contains a genuine prohibited cross-runtime reference. Fix: narrow the exclusion to exact, normalized repository-relative paths for the guard's own two files, and add a negative-control test that exercises auditRepositoryIsolationBoundary itself (not just findCrossRuntimeReferences) with a similarly-named-but-distinct fixture proving the bypass is closed. Also correcting the secondary defect: docs/spec/MIGRATION_BOUNDARY.md names build-and-test as the job that runs npm test; per .github/workflows/ci.yml that's actually the typescript job.
    • Branch: claude/issue-41-migration-004-isolation (existing, continuing PR Prove the M0 legacy/canonical isolation boundary (REQ-MIGRATION-004) #43)
    • Known blocker: none yet.
  7. added
    status:in-progressClaimed work with an active branch or pull request
    and removed
    status:in-progressClaimed work with an active branch or pull request
    on Sep 4, 2026
  8. added a commit that references this issue on Sep 4, 2026
    e814eca
  9. drevendev commented on Sep 4, 2026

    @drevendev
    Owner

    AUTHOR handoff

    What changed since the review

    • Fixed the exclusion-bypass defect both operator QA and the ACCEPTOR reproduced:
      excludingGuardModule in src/diagnostics/isolationBoundary.ts now matches an
      exact, normalized repository-relative path against the guard's own two files
      (diagnostics/isolationBoundary.ts, diagnostics/isolationBoundary.test.ts)
      instead of a substring match on isolationBoundary, which previously let any
      similarly-named file (e.g. src/domain/isolationBoundaryBridge.ts) escape the
      real-tree audit even with a genuine prohibited reference.
    • Added a negative-control test,
      auditRepositoryIsolationBoundary rejects a similarly-named-but-distinct file that the guard-module exclusion must not swallow, that builds such a fixture in a
      temporary directory and drives it through the real auditRepositoryIsolationBoundary
      traversal (not just the pure findCrossRuntimeReferences scan the original two
      negative controls used) — this is the path the original bypass lived in.
    • Corrected docs/spec/MIGRATION_BOUNDARY.md: it named build-and-test as the check
      running npm test; per .github/workflows/ci.yml that's the typescript job.
      Expanded the doc to state the exclusion is exact-path and to name the new test.
    • Updated the REQ-MIGRATION-004 row in docs/spec/IMPLEMENTATION_STATUS.md to
      reference PR Prove the M0 legacy/canonical isolation boundary (REQ-MIGRATION-004) #43 by number and the third negative-control test; status stays
      IN_PROGRESS, unchanged, pending merge.

    Checks at e814eca: npm ci/typecheck/test (11/11)/build passed;
    dotnet restore/build --configuration Release/test --configuration Release
    passed (45/45, unchanged); python3 -m unittest discover -s scripts/tests passed
    (40/40); python3 scripts/policy_guard.py --base origin/master passed (7 changed
    files). Full detail and evidence in the PR body.

    Remaining gate: none for this Issue's scope — handed off again for independent
    ACCEPTOR review. Setting status:needs-review, replacing status:in-progress.

  10. added
    status:needs-reviewImplementation complete, awaiting acceptance
    and removed
    status:in-progressClaimed work with an active branch or pull request
    on Sep 4, 2026
  11. added a commit that references this issue on Sep 4, 2026
    33683dd
  12. drevendev commented on Sep 4, 2026

    @drevendev
    Owner

    Merged in PR #43, squash commit 33683dd4224cac869d2eac982f756ae8fdb6ea7f (tested revision e814eca5317d39d1c79d82fd90346262605a8290).

    Independently verified at that head: npm ci/typecheck/test (6 files, 11 tests)/build all passed; dotnet build --configuration Release and dotnet test --configuration Release (45/45) passed; policy_guard.py passed over 7 changed files; all three required CI checks (build-and-test, policy-guard, typescript) green at this head. The exclusion-bypass defect from round 1 (bfe8969) is closed and covered by a new regression test that drives a similarly-named-but-distinct fixture through the real auditRepositoryIsolationBoundary traversal — I ran it directly and confirmed it passes.

    Full verdict: #43 (comment)

    Closing evidence and status label removed per docs/zendev/ACCEPTOR_RUNBOOK.md section 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:simulation-coreTick loop, ordering, determinism, configurationpriority:highImportant and time-sensitive; schedule ahead of normal worktype:architectureArchitecture, boundaries, contracts, or consequential design decisions

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions