Skip to content

feat(method): orientation-honesty — honest WM1 ≤12 via harness isolation + self-explaining surfaces (4 tasks)#155

Merged
pilotspacex-byte merged 5 commits into
mainfrom
feat/orientation-honesty
Jul 14, 2026
Merged

feat(method): orientation-honesty — honest WM1 ≤12 via harness isolation + self-explaining surfaces (4 tasks)#155
pilotspacex-byte merged 5 commits into
mainfrom
feat/orientation-honesty

Conversation

@pilotspacex-byte

Copy link
Copy Markdown
Contributor

orientation-honesty — honest WM1 ≤12 via harness isolation + self-explaining surfaces

Follow-on to call-residuals (PR #154). After that milestone, the user asked to investigate the real runs before spending on the paid WM1 re-measure. I anatomized the actual sixphase-r{1,2,3}/wm1 transcripts (benchmark/results/2026-07-callres-preflight-anatomy.md), which reshaped the plan:

  • The "20.7 calls" = 5.0 --help flag-discovery probes + 15.7 real per rep.
  • ~7–13 cmds/rep of startup confusion are HARNESS-induced: each WM workspace sat inside AIDD-Book's own .add/ tree, so the agent's first pre-init status root-walked UP to the parent project. A real greenfield user never hits this — part of the metric was measuring the nesting, not the method.
  • Two of call-residuals' four tasks targeted levers that measured zero (true double-init, unknown-command-typo); lever B (next-command-with-flags) was already ~80% shipped.

What shipped (4 tasks)

Task Lever Change Commit
harness-workspace-isolation harness find_root gains opt-in ADD_ROOT_CEILING (bounded upward walk); the WM runner sets it to the workspace dir so each rep resolves its OWN project a87ed1e
status-ancestor-warn warn full status prints a stderr note + exact init command when cwd has no .add/ but an ancestor resolved (--json/--brief silent) 1d9a211
orient-map B→pivot bare add.py/--help LEAD with a concise flow map (status/init/new-task/advance/freeze/gate) then the full list — kills the 50-choice dump probe. Pivoted here because lever B's flagged-next-command form was already shipped 0798bd2
guide-fold E a completing advance folds the LANDED phase's guide chapter (guide: .add/docs/<chapter> + "no re-run add.py guide" cue) above the footer — non-duplicative (footer already carries command+why) 91b3371

What did NOT ship — lever C (scope-violation-explain) was already shipped

Investigation found the scope_violation self-explaining surface already exists from the prior scope-gate-repair-path work:

  • M1 prevention (add.py:1487) — warns on the template-default §5 Scope + names re-cross --by.
  • M2 repair (add.py:5907) — explains the full resolution rule + emits the paste-ready add.py re-cross --by <name> + the revert alternative.

The code comment at add.py:5902-5905 records this exact fix already killed "the live-benchmark agent source-diving for ~10 turns to discover re-cross" — the precise pain lever C was scoped to fix. Per First-Principles honesty, no redundant 5th task was built (human decision 2026-07-14 — close the build at 4).

Discipline

  • Every add.py change synced ×4 twins byte-identically; ENGINE_PKG_MD5→955023db, ENGINE_MD5→c8e0a3e5; SEAMS _declared_scope migrated 5688→5711→5723.
  • Red/green TDD on every task; new tests never synced across twins.
  • Full fence green (3611 passed; the lone bundle-parity fail was a gitignored .pyc compiled into the bundle by the test run itself, removed — not a code defect).

Deferred (human-gated)

The milestone GOAL — an honest WM1 ≤12 — stays open on the paid re-measure IN THE ISOLATED HARNESS (calls ≤12, fidelity ≥0.97, ≤1 --help/rep, zero root-walk confusion). That spend is the user's to run after this merges. The benchmark model pin (claude-sonnet-5) is unchanged for reproducibility.

…sted WM workspace resolves its own project

orientation-honesty task 1 of 5. The call-residuals pre-measure anatomy
(benchmark/results/2026-07-callres-preflight-anatomy.md) proved 7-13 startup
cmds/rep were HARNESS-induced: the benchmark runs each WM workspace at
benchmark/runs/<arm>/wm<N>/workspace — INSIDE AIDD-Book's own .add/ tree — so
the agent's first pre-init `status` walks up and resolves the PARENT project,
then burns ~10 cmds grepping find_root/STATE_FILE internals before `init`. A
real greenfield user never hits this; the number was partly metering the nesting.

- add_engine/io_state.py :: find_root gains an OPT-IN env ceiling. When
  `ADD_ROOT_CEILING` is set, the upward walk stops at that dir (INCLUSIVE — the
  break is AFTER the state.json check so the workspace's own post-init .add/
  still resolves) and never ascends above it. Both cwd and ceiling are
  .resolve()d so a symlinked tmpdir (macOS /var->/private/var) still matches.
  Env UNSET is byte-identical to the legacy walk — the guard is invisible to
  every non-harness caller (mirrors the engine's ADD_NO_UPDATE_CHECK/NO_COLOR
  opt-in idiom). Synced x4 engine twins.
- benchmark/runner/core.py :: _invoke_once passes
  env={**os.environ, "ADD_ROOT_CEILING": str(cwd)} to the agent Popen, so every
  benchmark run scopes the agent's root-walk to its workspace. cmd_init already
  writes .add/ at cwd, so only the pre-init READ leaked — one env injection fixes it.
- ENGINE_PKG_MD5 -> 955023db (add_engine package digest re-pinned, x4 twins);
  ENGINE_MD5 UNCHANGED (add.py untouched); SEAMS untouched (no add.py line moved).

Red first: test_findroot_ceiling (engine — ancestor-above-ceiling resolved the
PARENT before the code) + benchmark/tests/test_workspace_isolation (env UNSET).
Green: 28 engine (incl. test_engine_extract_md5 PKG parity + test_engine_extract_io_state
+ test_engine_repin_parity) + 189 benchmark + full tooling fence. One human freeze
at the frozen §3 contract.

author: Tin Dang <tindang.ht97@gmail.com>
…t it resolved + hands the exact init

orientation-honesty task 2 of 5. Behind the harness ceiling (task 1), a real user
in a nested/monorepo dir with no local .add/ still gets `status` silently resolving
an ANCESTOR project — the same confusion the pre-measure anatomy saw the benchmark
agent grep find_root internals over. Now `status` says so and hands the fix.

- new _ancestor_note(): when cwd has no .add/state.json of its own but find_root()
  walked up to one, returns a one-line note naming the resolved ancestor + the exact
  `add.py init --name "<project>" --stage <...>` to scope a project HERE (the
  _require_root skip-error precedent — hand the command with flags, never a bare
  hint). Silent when cwd owns a project or none is reachable.
- cmd_status prints it to STDERR on the FULL path only — --json/--brief/--section
  stay silent so machine callers and pipes are never polluted; exit code + the
  normal status body are unchanged.

Message-layer only — no gate/enforcement/state change. Red first
(test_status_ancestor_warn: note-present + two silent cases). Synced x4 add.py twins,
ENGINE_MD5 -> 9476543399; SEAMS _declared_scope re-pinned 5688->5711 (cmd_status grew
_ancestor_note above it). Full fence green (3604 passed).

author: Tin Dang <tindang.ht97@gmail.com>
…low map, not the 50-choice dump

orientation-honesty task 3 of 5. The pre-measure anatomy showed the flag-carrying
next-command hints from prior tasks (first-call-ergonomics / skip-error-ergonomics /
engine-hint-batch-ops) already cover freeze/advance/new-task/init — the sixphase
agent actually ran `freeze --by ... --cross`. The true residual is the stubborn
1/rep INITIAL orientation probe: `add.py --help` (and bare `add.py`) dumped the
~50-choice argparse usage, which help-habit-kill never touched (it only caught
UNKNOWN commands).

- new _FLOW_MAP: a flow-ordered map — status (start here) · init · new-task ·
  advance · freeze · gate — each with its key flags on one line.
- _AddArgParser.format_help(): the TOP parser (prog == "add.py") LEADS with the map,
  then the full argparse command list still follows — nothing lost; `add.py --help |
  head` now surfaces orientation instead of alphabet soup. A subcommand's own --help
  (prog "add.py <cmd>") is byte-identical argparse.
- _AddArgParser.error(): a bare `add.py` (no subcommand → "the following arguments
  are required") prints the map + `run: add.py status` to stderr, exit 2 — not the
  raw dump. The help-habit-kill invalid-choice branch is unchanged.

Message-layer only — no gate/enforcement/state change. Red first (test_orient_map:
map-leads-then-full-list · bare-to-stderr · subcommand-help-unchanged · unknown-
command-unchanged). Synced x4 add.py twins, ENGINE_MD5 -> a88bc24c; SEAMS unchanged
(_declared_scope still 5711 — the class sits below it). Full fence green (3608 passed).

author: Tin Dang <tindang.ht97@gmail.com>
…guide` (guide-fold)

The anatomy's orientation residual: agents re-run `add.py guide` after every
advance even though the `next:` footer already carries the phase command + short
why. The ONE line the footer lacks is the guide's chapter reference — so a
completing `advance` now folds it in.

A completing advance that lands an agent INTO a working phase prints, right ABOVE
the `next:` footer:

    guide: .add/docs/<chapter> — the phase chapter (this + the next line ARE
                                 `add.py guide`; no separate call)

The chapter is the LANDED phase's (PHASE_GUIDE[nxt][1], the same source
cmd_guide's `read:` line uses), so specify→plan folds 05-step-3-plan.md,
plan→tests folds 06-step-4-tests.md, etc. This is strictly non-duplicative: the
footer keeps its command+why unchanged (still exactly one `next:` line); the fold
adds only the chapter + the don't-re-run cue.

Suppressed where it would be wrong:
- landing in `done` folds nothing — Arm B (the milestone decision) owns that
  juncture, only the footer prints.
- bundle fast-forward intermediates never fold (they `return` above the print);
  only the final landing folds — exactly one fold per completing advance.
- fail-soft: a corrupt/unmapped landed phase folds nothing via PHASE_GUIDE.get,
  never a KeyError on an already-saved advance (the footer's own ethos).

Kept in cmd_advance (not inside _next_footer) so the footer stays a pure
single-`next:`-line resolver reused by status/gate/new-task — the fold must not
leak a chapter line onto those surfaces.

Task 4/5 of the orientation-honesty milestone (lever E). Red/green:
test_guide_fold — the 3 fold asserts were RED (0 fold lines) before the print
existed; the done-landing assert guards the fold from the Arm-B juncture. Synced
×4 add.py twins; ENGINE_MD5→c8e0a3e5; SEAMS _declared_scope re-pinned 5711→5723
(the fold + comment sit above it in cmd_advance).

author: Tin Dang <tindang.ht97@gmail.com>
…e-shipped

Record the milestone outcome: 4 built tasks (harness-workspace-isolation,
status-ancestor-warn, orient-map, guide-fold) all gate=PASS + green, and
lever C (scope-violation-explain) found ALREADY SHIPPED by the prior
scope-gate-repair-path work (M1 add.py:1487 prevention, M2 add.py:5907 repair —
both explain the rule + emit the paste-ready `re-cross --by`). No redundant 5th
task built (human decision 2026-07-14). The milestone GOAL (honest WM1 <=12)
stays open on the deferred, human-gated paid re-measure in the isolated harness.

author: Tin Dang <tindang.ht97@gmail.com>
import os
import shutil
import tempfile
import unittest
@pilotspacex-byte pilotspacex-byte merged commit a19eece into main Jul 14, 2026
11 of 12 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.

2 participants