Skip to content

Run a saved goal phase through the coding and verification loop - #299

Merged
AetherAI3 merged 1 commit into
mainfrom
feat/issue-287-goal-phase-run
Oct 6, 2026
Merged

AetherAI3 merged 1 commit into
mainfrom
feat/issue-287-goal-phase-run

Conversation

@AetherAI3

Copy link
Copy Markdown
Owner

Summary

  • Add /goal run [id] to execute exactly one accepted saved phase through the existing host coding loop in its selected workspace, with the accepted objective, constraints, notes, criteria, model, and check command.
  • Persist a phase attempt, session and turn IDs, workspace/model, tree before and after, touched files, host check receipt, verification state, and refusal or failure reason. Require an attributable green receipt for the current tree and criteria that the host check can actually prove before marking the phase complete.
  • Add cross-process phase leasing, checkpoint reconciliation and explicit resume, pause, and cancel. Keep /goal start and /goal complete as clearly labeled manual tracking. The next phase requires another explicit run, and publication remains a separate action.

Verification

  • npm run build — passed.
  • Focused regression suite — 91 passed, 0 failed, including a real host file-tool and verification fixture, stale/red/missing checks, auth and tool refusal, duplicate starts, pause/cancel, and restart reconciliation without replay.
  • Focused goal-run suite after final concurrency fixes — 15 passed, 0 failed.
  • npm run docs:check and git diff --check — passed.

Live hosted-service qualification is outside this implementation ticket's scope.

Closes #287

@AetherAI3
AetherAI3 force-pushed the feat/issue-287-goal-phase-run branch from d7ffe31 to ff75d69 Compare October 6, 2026 15:27
@AetherAI3
AetherAI3 merged commit 64d75af into main Oct 6, 2026
1 of 8 checks passed
@AetherAI3
AetherAI3 deleted the feat/issue-287-goal-phase-run branch October 6, 2026 15:29
AetherAI3 added a commit that referenced this pull request Oct 6, 2026
The host's own verifier readings now reach an active RC session's Tests
panel (#219): the final gate of `aether agent` (through the run's own
coding observer), `aether review verify`, and stored readings shown by
`aether review` (the source of "stale").

- testsEvent publishes the verifier's status plus a closed-vocabulary
  reason and, for a failure, the exit code; no command, output, local
  reason or parsed counts.
- Killed runs (130/124 or an aborted signal), a tree that moved during
  the run, and a tree that cannot be fully identified are "unknown" and
  are never recorded or read back as a pass.
- A frame field the outbox sanitizer would rewrite is dropped; without
  its status the reading is not sent, so no 400 can wedge the outbox.
- The coding observer reloads the outbox before enqueueing when no
  upload is in flight, so a standalone review's queued reading is not
  saved over.
- RC failures never change verdicts or exit codes; nothing is awaited.

Integrated onto #289 (874b36b): whether a check completed is the
CheckReading the agent footer renders (verify_gate readCheck), so a kill is
read from the executor's own markers or an aborted signal, never an exit
code alone; verifyAndRecord maps cancelled/timed_out onto these causes. In
`aether agent` the gate's reading is the one verifyAndRecord records for the
review rail (recordingRunner hands it over), published by
verifyCodeTurnInCheckout; without a recorded run the CheckReading alone is
published (no command, not run, could not start, killed, or unattributed).
A check that cannot start reads "the check could not start" (new
launch_failed cause). publishDiff (#218) shares the observer's single
reload-before-enqueue path.

The review-rail kill test follows #289's executor-marker rule: a command that exits 124/130 by itself is a completed, recorded failure; only an executor kill ([aborted]/[timeout after Ns]) is unknown and unrecorded.

Integrated with #299: recordingRunner keeps #299's onResult callback, which
receives the whole VerifyRunResult. verifyCodeTurnInCheckout captures the
recorded {reading, written} once, publishes the reading to RC as before, and
returns it as recordedCheck; cmdCode hands that receipt to the session log
and to the goal-phase runObserver exactly as #299 did.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
AetherAI3 added a commit that referenced this pull request Oct 6, 2026
A coding run that finds an attached RC session now binds one host lifetime
to itself (#223). The new host pump (src/core/rc/pump.ts) heartbeats the
session every 5 s (the Cloud's HEARTBEAT_INTERVAL_S), drains the durable
outbox in at most 32 bounded batches per tick whenever events are queued,
backs off on retryDelayMs's capped jittered curve (1 s to 60 s) on outages,
rate limits and unproven receipts, and stops for good on terminal,
revoked/expired/closed or ownership answers and on a local revoke. Every
timer is unref'd, nothing throws into the run, and the run's `finally` makes
one final flush bounded by a 1.5 s deadline before aborting whatever is still
in flight. Events left queued stay durable, and the next run resumes
delivering them once a heartbeat proves the session is still this host's.

The outbox file is now the single truth between its writers. The coding
observer read-modify-writes the file instead of saving a long-lived copy, the
pump adopts the file on every tick, and flushOutbox reloads it before sending
and again before committing receipts (receipts are validated against the
cursor at send time; the cursor never moves backwards). Previously the
observer, /orchestra and a receipt landing mid-batch could each save over
events another writer had queued, losing them for good while the broker was
offline.

Heartbeat and delivery run on independent clocks. Delivery backing off (a
refusing or rate-limited events route) never silences the 5 s heartbeat, a
long drain heartbeats between batches, and delivery only runs on a session a
heartbeat proved live. A local read or receipt write that fails on a lock
backs off instead of stopping the host; damaged bytes still stop it. The
close deadline timer is ref'd so a run cannot exit mid-await.

Tests run on a virtual clock: a 90 s outage with backoff and no lost events,
reconnect and duplicate-safe replay (host_event_id dedupe, cursor advancing
only on full receipts), termination on revoked/expired/not-found, a bounded
final flush against a hung broker, resume on the next run, and both
multi-writer races with the broker offline and with a receipt in flight.

Further regression tests: heartbeat cadence under delivery backoff, an
unreadable-then-restored and then damaged outbox, an unwritable receipt that
is replayed, and two writers flushing overlapping batches without wedging the
cursor.

Integrated after #218/#219: the observer's publish() (the verify gate's
tests reading) and publishDiff() use the same read-modify-write-the-file path
as feed() and wake the pump, replacing #219's reload-unless-flushing copy.
The run-end diff measurement is no longer awaited by the run; close() waits
for it only inside its one 1.5 s deadline, then makes the final flush
(tests: close delivers a diff that finishes in time; a measurement that never
finishes cannot hold close past the deadline). `aether review` publishes
through a one-shot seam (rc/publish.ts: load, isPublishable, enqueue, save,
flushOutbox) instead of opening a coding observer, whose pump would heartbeat
for the life of a REPL. #219's broker stub answers heartbeats.

Integrated with #299: the hoisted rcObserver sits beside #299's external
abort-signal wiring, and the outer finally removes that abort listener before
the bounded rcObserver.close().

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
AetherAI3 added a commit that referenced this pull request Oct 6, 2026
The host's own verifier readings now reach an active RC session's Tests
panel (#219): the final gate of `aether agent` (through the run's own
coding observer), `aether review verify`, and stored readings shown by
`aether review` (the source of "stale").

- testsEvent publishes the verifier's status plus a closed-vocabulary
  reason and, for a failure, the exit code; no command, output, local
  reason or parsed counts.
- Killed runs (130/124 or an aborted signal), a tree that moved during
  the run, and a tree that cannot be fully identified are "unknown" and
  are never recorded or read back as a pass.
- A frame field the outbox sanitizer would rewrite is dropped; without
  its status the reading is not sent, so no 400 can wedge the outbox.
- The coding observer reloads the outbox before enqueueing when no
  upload is in flight, so a standalone review's queued reading is not
  saved over.
- RC failures never change verdicts or exit codes; nothing is awaited.

Integrated onto #289 (874b36b): whether a check completed is the
CheckReading the agent footer renders (verify_gate readCheck), so a kill is
read from the executor's own markers or an aborted signal, never an exit
code alone; verifyAndRecord maps cancelled/timed_out onto these causes. In
`aether agent` the gate's reading is the one verifyAndRecord records for the
review rail (recordingRunner hands it over), published by
verifyCodeTurnInCheckout; without a recorded run the CheckReading alone is
published (no command, not run, could not start, killed, or unattributed).
A check that cannot start reads "the check could not start" (new
launch_failed cause). publishDiff (#218) shares the observer's single
reload-before-enqueue path.

The review-rail kill test follows #289's executor-marker rule: a command that exits 124/130 by itself is a completed, recorded failure; only an executor kill ([aborted]/[timeout after Ns]) is unknown and unrecorded.

Integrated with #299: recordingRunner keeps #299's onResult callback, which
receives the whole VerifyRunResult. verifyCodeTurnInCheckout captures the
recorded {reading, written} once, publishes the reading to RC as before, and
returns it as recordedCheck; cmdCode hands that receipt to the session log
and to the goal-phase runObserver exactly as #299 did.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
AetherAI3 added a commit that referenced this pull request Oct 6, 2026
A coding run that finds an attached RC session now binds one host lifetime
to itself (#223). The new host pump (src/core/rc/pump.ts) heartbeats the
session every 5 s (the Cloud's HEARTBEAT_INTERVAL_S), drains the durable
outbox in at most 32 bounded batches per tick whenever events are queued,
backs off on retryDelayMs's capped jittered curve (1 s to 60 s) on outages,
rate limits and unproven receipts, and stops for good on terminal,
revoked/expired/closed or ownership answers and on a local revoke. Every
timer is unref'd, nothing throws into the run, and the run's `finally` makes
one final flush bounded by a 1.5 s deadline before aborting whatever is still
in flight. Events left queued stay durable, and the next run resumes
delivering them once a heartbeat proves the session is still this host's.

The outbox file is now the single truth between its writers. The coding
observer read-modify-writes the file instead of saving a long-lived copy, the
pump adopts the file on every tick, and flushOutbox reloads it before sending
and again before committing receipts (receipts are validated against the
cursor at send time; the cursor never moves backwards). Previously the
observer, /orchestra and a receipt landing mid-batch could each save over
events another writer had queued, losing them for good while the broker was
offline.

Heartbeat and delivery run on independent clocks. Delivery backing off (a
refusing or rate-limited events route) never silences the 5 s heartbeat, a
long drain heartbeats between batches, and delivery only runs on a session a
heartbeat proved live. A local read or receipt write that fails on a lock
backs off instead of stopping the host; damaged bytes still stop it. The
close deadline timer is ref'd so a run cannot exit mid-await.

Tests run on a virtual clock: a 90 s outage with backoff and no lost events,
reconnect and duplicate-safe replay (host_event_id dedupe, cursor advancing
only on full receipts), termination on revoked/expired/not-found, a bounded
final flush against a hung broker, resume on the next run, and both
multi-writer races with the broker offline and with a receipt in flight.

Further regression tests: heartbeat cadence under delivery backoff, an
unreadable-then-restored and then damaged outbox, an unwritable receipt that
is replayed, and two writers flushing overlapping batches without wedging the
cursor.

Integrated after #218/#219: the observer's publish() (the verify gate's
tests reading) and publishDiff() use the same read-modify-write-the-file path
as feed() and wake the pump, replacing #219's reload-unless-flushing copy.
The run-end diff measurement is no longer awaited by the run; close() waits
for it only inside its one 1.5 s deadline, then makes the final flush
(tests: close delivers a diff that finishes in time; a measurement that never
finishes cannot hold close past the deadline). `aether review` publishes
through a one-shot seam (rc/publish.ts: load, isPublishable, enqueue, save,
flushOutbox) instead of opening a coding observer, whose pump would heartbeat
for the life of a REPL. #219's broker stub answers heartbeats.

Integrated with #299: the hoisted rcObserver sits beside #299's external
abort-signal wiring, and the outer finally removes that abort listener before
the bounded rcObserver.close().

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.

[feature] Drive one saved goal phase through the coding and verification loop

1 participant