Skip to content

test: S7 plan and the Layer B harness - #23

Merged
vunm-dev merged 4 commits into
release/v0.5.0from
docs/pdn-0004-s7-plan
Sep 26, 2026
Merged

vunm-dev merged 4 commits into
release/v0.5.0from
docs/pdn-0004-s7-plan

Conversation

@vunm-dev

Copy link
Copy Markdown
Member

PDN-0004, slice S7, first part. Plan: docs/superpowers/plans/2026-09-25-pdn-0004-s7-release.md. Gate: §20.2 as narrowed in #22. Issue #12.

What changes

  • S7 plan (7 tasks). Tasks 1.1 and 2.1–2.3 are done here. Task 3.1 (running Layer B) needs the owner at the keyboard; 4.x is the release docs and the release itself.

  • Task 1.1, host isolation. Measured first: a claude -p host on the owner's machine loaded both the 0.4.0 plugin (passdown:passdown-*) and the direct v0.5 copies (passdown-*), and when asked to list them it left one out. The owner moved Claude to the beta plugin channel pinned to release/v0.5.0 and dropped the direct copies. Now doctor.sh reports "install channels are clean", and the host sees exactly one set, byte-identical to this branch.

  • tests/harness/layer-b/:

    File Role
    fixture.sh Builds each scenario workspace: plan, AGENTS.md with an owner routing policy, and a card for the test double in the scenario's mode
    scenarios/<S>.sh Crash marker, ground truth and expected behavior of one scenario
    run.sh Runs the real host, kills it at the marker, opens a new session for pickup, relays the owner's answers verbatim (never answers or attests for them), then collects and judges
    collect.sh, oracle.sh Copy the files after a run and judge them from files only
    README.md Operator instructions
  • CI: shellcheck now names the harness files; the tests/harness/* glob started matching the new directory.

Pilots (not evidence)

  • F1: the host went new → arm → running → unknown --parent-exited → result, then stopped and asked the owner to attest instead of recording it. The oracle correctly fails that unfinished state (the worker's [x] is still in the plan).
  • F27: the host created no attempt, wrote no Dispatched: line, did not do the task, and reported the missing ghost card with remedies. The oracle passed all six checks.

Review focus

  1. Oracle ground truths per scenario (scenarios/*.sh). F1 and F2 are must-not-accept, which also forbids a leftover [x], following §20.1's "any plan [x]" rule.
  2. The crash markers in run.sh, especially after-arm: armed, with no handle yet.
  3. Anything in run.sh that could answer or attest for the owner.

🤖 Generated with Claude Code

vunm-dev and others added 3 commits September 25, 2026 16:06
Seven tasks for the release slice under the gate narrowed in #22: isolate
the Layer B host, build the Layer B fixture, stage markers and file
oracles, write the scenario scripts, run Layer B with the owner, write the
release docs, and cut the release. Task 1.1 is done: a claude -p host
loaded both the 0.4.0 plugin and the direct v0.5 copies, so the owner
moved Claude to the beta plugin channel pinned to release/v0.5.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/harness/layer-b/ runs the gate scenarios of #22 (F1, F2, F11, F14a,
F14b, F18, F27) against a real `claude -p` host with the v0.5 skills:

- fixture.sh builds each scenario's workspace: a plan, an AGENTS.md with an
  owner routing policy, and an executor card for the test double in the
  scenario's mode. F27 routes to an executor that has no card.
- run.sh kills the host at the scenario's crash marker (after-arm,
  after-result, after-verdict), applies the scenario's edit, and opens a
  new session for pickup. It relays the owner's answers verbatim and never
  answers or attests for them.
- collect.sh and oracle.sh judge a run from files only: contract,
  acceptance by ground truth, final-tree digests, stop evidence, no second
  writer, no overlapping worker lifetimes.

A pilot F1 run showed the host stopping to ask for attestation, and the
oracle failed that unfinished state as it should. A smoke F27 run passed all
checks. Neither counts as evidence; plan task 3.1 runs the gate with the
owner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The glob `tests/harness/*` now also matches the `layer-b/` directory, which
shellcheck rejects. List the harness scripts, the Layer B scripts and the
evidence scripts explicitly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@vunm-dev vunm-dev left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommendation: address both P1 findings before merging.

Two issues prevent this harness from providing reliable Layer B release evidence.

Validation: on the current PR head, I ran fixture.sh -> collect.sh -> oracle.sh for F1, F2, F11, F14a, F14b, F18 and F27 without launching a host or worker. All seven returned pass. The crash-monitoring finding comes from tracing the initial and resumed host calls against the required owner-attestation flow. CI is green; I did not run a live owner-attested Layer B session or change repository files.

Comment thread tests/harness/layer-b/run.sh Outdated
IFS= read -r answer </dev/tty || answer=""
[ -n "$answer" ] || break
printf '[%s] %s\n' "$operator" "$answer" >>"$out/owner-answers.txt"
host "$session" "$answer"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Preserve crash monitoring across owner replies

F14a/F14b require owner attestation before the host can persist an accepted verdict. The initial host call therefore returns before reaching the marker, but this resumed call omits the watcher argument. Crash handling also exists only before this loop, so the scenario never applies its mutation or starts pickup. Keep monitoring subsequent turns until the marker fires, and handle the crash and recovery from that turn.

@vunm-dev vunm-dev Sep 26, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 8b6a332. Every host turn is now watched for the marker until it fires once, including the turns resumed with the owner's answers. The crash is handled in the turn where it happens: the scenario's after_crash edit, then a new pickup session. run.sh records turn, crash, after_crash and pickup events in run-events.txt. Tested with a stub host under a pseudo-terminal (no answer back door): F14a's marker fired in resumed turn 02, the task edit landed, and pickup ran in turn 03.

Comment on lines +39 to +46
case "$GROUND_TRUTH" in
must-not-accept)
[ "${#accepted[@]}" = 0 ] && ok "no receipt accepted" || no "a receipt was accepted"
[ "$ticked" = 0 ] && ok "task 1.1 is not ticked" || no "task 1.1 is ticked: $task_line"
;;
must-not-project)
[ "${#projected[@]}" = 0 ] && ok "no verdict projected" || no "a verdict was projected"
[ "$ticked" = 0 ] && ok "task 1.1 is not ticked" || no "task 1.1 is ticked: $task_line"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Require evidence that each scenario actually ran

Running fixture.sh, collect.sh and oracle.sh without launching any host or worker returns pass for all seven scenarios. Empty receipts and journals satisfy these negative assertions, so an aborted or never-exercised run can qualify as release evidence. Require scenario-specific execution evidence before judging safety: worker activity where expected, the crash marker and recovery for crash scenarios, and an accepted verdict plus the intended digest change for F14. Missing evidence must be incomplete or failure.

@vunm-dev vunm-dev Sep 26, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 8b6a332. Each scenario now lists the evidence it requires (REQUIRE):

  • F1: host worker
  • F2: host worker crash pickup
  • F11: host crash pickup (the worker may not have launched before the crash)
  • F14a: host worker crash after_crash pickup accepted task-changed
  • F14b: host worker crash after_crash pickup accepted artifact-changed
  • F18: host worker detached-write
  • F27: host

Missing evidence makes the result INCOMPLETE (exit 2), never a pass. Your fixture → collect → oracle run now gives INCOMPLETE for all seven scenarios, and the earlier real-host F27 smoke run still passes. The oracle also now reports an unexpected error as FAIL instead of exiting without a result; a stub run with a malformed receipt exposed that.

…l run

Review on #23:

- run.sh watched for the crash marker only in the first host turn. F14's
  accepted verdict comes after the owner's attestation, in a resumed turn,
  so the marker never fired and neither the scenario edit nor pickup ran.
  Every turn is now watched until the marker fires once, and the crash is
  handled in that turn. run.sh also records turn, crash, after_crash and
  pickup events in run-events.txt.
- oracle.sh passed all seven scenarios when no host or worker had run,
  because empty receipts and journals satisfy every negative check. Each
  scenario now lists the evidence it requires (REQUIRE): a completed host
  turn, the worker, the crash and pickup, an accepted verdict, a changed
  task or artifact, the detached write. Missing evidence makes the run
  INCOMPLETE (exit 2), never a pass. The oracle also no longer dies
  silently on a malformed receipt: an unexpected error is reported as FAIL.

Tested without a live host:
- the reviewer's fixture → collect → oracle run now gives INCOMPLETE for
  all seven scenarios;
- the earlier real-host F27 smoke run still passes;
- a stub host under a pseudo-terminal showed F14a's crash caught in the
  resumed turn, the scenario edit applied, and a pickup session started.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vunm-dev
vunm-dev merged commit ab1a321 into release/v0.5.0 Sep 26, 2026
7 checks passed
@vunm-dev
vunm-dev deleted the docs/pdn-0004-s7-plan branch September 26, 2026 16:36
vunm-dev added a commit that referenced this pull request Sep 30, 2026
…l run

Review on #23:

- run.sh watched for the crash marker only in the first host turn. F14's
  accepted verdict comes after the owner's attestation, in a resumed turn,
  so the marker never fired and neither the scenario edit nor pickup ran.
  Every turn is now watched until the marker fires once, and the crash is
  handled in that turn. run.sh also records turn, crash, after_crash and
  pickup events in run-events.txt.
- oracle.sh passed all seven scenarios when no host or worker had run,
  because empty receipts and journals satisfy every negative check. Each
  scenario now lists the evidence it requires (REQUIRE): a completed host
  turn, the worker, the crash and pickup, an accepted verdict, a changed
  task or artifact, the detached write. Missing evidence makes the run
  INCOMPLETE (exit 2), never a pass. The oracle also no longer dies
  silently on a malformed receipt: an unexpected error is reported as FAIL.

Tested without a live host:
- the reviewer's fixture → collect → oracle run now gives INCOMPLETE for
  all seven scenarios;
- the earlier real-host F27 smoke run still passes;
- a stub host under a pseudo-terminal showed F14a's crash caught in the
  resumed turn, the scenario edit applied, and a pickup session started.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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