Skip to content

5.1 Resident pure-M harness (P0–P3)#3

Merged
rafael5 merged 5 commits into
mainfrom
resident-harness-5.1
May 31, 2026
Merged

5.1 Resident pure-M harness (P0–P3)#3
rafael5 merged 5 commits into
mainfrom
resident-harness-5.1

Conversation

@rafael5

@rafael5 rafael5 commented May 31, 2026

Copy link
Copy Markdown
Contributor

Stage 5.1 — the resident pure-M harness (the last engine-bound piece). Implements the server-side half of run-and-verify per resident-harness-design.md and spec §9.

The harness's contract is its output frame, not its transport: the resident orchestrator (pure-M, m-stdlib) emits a deterministic ##-envelope of verbatim ^STDASSERT per-suite blocks + a verbatim LCOV block that the existing mtest.ParseOutput / mcov consume unchanged. This Go side is a thin frame-splitter + trigger.

Landing incrementally on this branch:

  • P0 ✅ — frame contract + SplitFrame (host-side, no engine). Golden-frame tests: each block round-trips through unchanged mtest.ParseOutput; LCOV via new mcov.ParseLCOV.
  • P1 — resident orchestrator RUN^STDHARN (pure-M, m-stdlib); G4 parity resident-on-YDB vs file-side.
  • P2 — coverage block (^%MONLBL##LCOV).
  • P3m test/coverage --resident + m watch IRIS run-half + Reconcile + ;; tier: marker.

🤖 Generated with Claude Code

rafael5 and others added 5 commits May 30, 2026 22:40
New internal/harness package — the host-side trigger/render client for the
resident pure-M harness (design §3.1/§3.2). SplitFrame splits the deterministic
##-envelope into per-suite ^STDASSERT blocks + the LCOV block + provenance/
summary FrameMeta. It is delimiter-scanning only: no test/coverage parse logic
lives here. Each suite Body is verbatim ^STDASSERT fed to the UNCHANGED
mtest.ParseOutput; the ##LCOV block is verbatim LCOV fed to mcov. This is what
structurally guarantees G4 cross-engine parity — both tiers speak one dialect.

- ErrNoFrame (missing header) and ErrTruncated (missing/mismatched trailer, so a
  dropped connection is detectable); partial results returned alongside.
- Unknown ## directives skip gracefully (forward-compat).
- mcov.ParseLCOV: inverse of mcov.LCOV, so a coverage payload arriving as text
  (the ##LCOV block) joins the same ByFile/Percent consumers a host-side
  mcov.Run produces. Tolerates TN:/LF:/LH: records.

Golden-frame tests prove each split block round-trips through the unchanged
mtest.ParseOutput and the LCOV block through mcov.ByFile. Host-side, no engine.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…, 5.1)

- Trigger(ctx, eng, scope) invokes RUN^STDHARN via the engine adapter and
  returns the raw result frame (design §3.1 CLI trigger path). Pure delegation;
  scope rides $ZCMDLINE, the frame comes back on stdout, and the same frame
  travels over T.1's WebSocket unchanged.
- TestResidentParityYDB (opt-in, M_TEST_LIVE) is stage 5.1's gate G4: the SAME
  *TST suites yield IDENTICAL mtest.Summary file-side (one process per suite)
  vs resident (one RUN^STDHARN, split via SplitFrame). Pure-M makes this
  exercisable on YDB with no IRIS. Covers a deliberately-failing fixture
  (testdata/PARITYFAILTST.m) to prove FAIL-path parity through the no-halt
  mechanism — the failing suite frames without halting the orchestrator.

Verified live against the m-test-engine YDB container: STDMATHTST/STDSTRTST/
STDSEMVERTST/STDHEXTST + PARITYFAILTST all parity-match across both tiers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…gines)

Drive run^STDHARN via RunScript (an M argument) instead of RUN^STDHARN's
$ZCMDLINE — IRIS has no $ZCMDLINE (<SYNTAX>), so the script path is engine-
portable. Generalize TestResidentParity into an engine-parameterized helper +
add TestResidentParityIRIS (stage dir under /tmp on IRIS, IrisStageLoad).

Result: the SAME suites + the deliberately-failing fixture yield IDENTICAL
mtest.Summary resident vs file-side on BOTH the YDB file-side tier AND the IRIS
resident tier — the test half of G4 across both engines.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- SplitFrame extracts the raw ##MON line-monitor block (alongside suites/LCOV);
  ##END-MON never closes a suite ##END. TestSplitFrameMonBlock covers it.
- mcov.FromMonitor joins a ##MON block (MLINE:routine:line:count) to the parse-
  tree executable lines — the host-side half of resident IRIS coverage. Shares
  joinMon with the host-orchestrated runIris, so resident == file-side coverage
  by construction. TestFromMonitor (host-side, no engine).
- harness.TriggerCoverage drives cov^STDHARN (RunScript, portable).

Gate (G4 coverage half): TestResidentCoverageParityIRIS proves resident IRIS
coverage (cov^STDHARN → ##MON → FromMonitor) ByFile == host-orchestrated IRIS
coverage (mcov.Run → %Monitor): STDMATH 29/30, host == resident. With 4.1's
host IRIS==YDB LCOV parity, coverage parity holds across both tiers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolves design Q5 (tier marker) and implements the §9.1-Q6 reconciliation.

- mtest: TestSuite.Tier + DetectTier read a `;; tier: integration` directive at
  discovery (untagged ⇒ pure-logic, the safe default that keeps a suite the
  file-side PR gate). Inline or own-line comment, case-insensitive.
- harness.Reconcile: one verdict by provenance — file-side authoritative for
  pure-logic, resident for integration; resident wins a same-suite conflict
  (reality); OK = UNION (any failure on either tier ⇒ non-zero exit).
- harness.RunResident: trigger → SplitFrame → []mtest.RunResult (OK = summary.OK
  && ##END exit==0, same rule as mtest.RunSuite); truncated frame ⇒ error.
- m test --resident: partitions discovered suites by tier, runs pure-logic
  file-side + integration via the resident harness, reconciles, reports each
  suite tagged by tier, exits on the union.

Verified live on vista-iris: a pure-logic suite runs file-side and an
integration-tagged suite runs resident in one reconciled report; a failing
integration suite drives exit 3 (union). Host-side unit tests cover DetectTier,
Reconcile (union + conflict), and RunResident (mapping + truncation).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rafael5 rafael5 merged commit 856065b into main May 31, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant