Commit Graph

33 Commits

Author SHA1 Message Date
Hmbown 0de86c7836 test(tui): pin injection sizes — child envelope, parent surface, turn_meta
R6 (finish-operator 2026-08-02): the only envelope number anyone quoted
was a stale fixture comment (workflows/stopship.workflow.js:1-5,
17,457–17,550 tokens from an old live run). Nothing failed when the
assembled payloads grew. Three regressions now build — never send —
the real payloads and pin them at measured-current +10%:

- read_only_child_envelope_stays_within_measured_ceiling: scout system
  prompt + seed messages + child tool catalog = 80,856 bytes measured
  (~20k tokens — the old 17.5k figure was already low); ceiling 89,000.
- parent_agent_surface_stays_within_measured_ceiling: BASE_PROMPT +
  full parent tool catalog = 72,679 bytes measured; ceiling 80,000.
- turn_meta_block_stays_within_measured_ceiling: per-turn <turn_meta>
  block via the production snapshot path = 254 bytes measured
  (includes the new sandbox-posture line); ceiling 280.

Each failure message says how to raise the ceiling honestly (re-measure
in the same commit). The stopship fixture comment now points at the
pinned test instead of the stale token figure.

Proof the ceilings bite: a scratch diff padding BASE_PROMPT +15,000B,
the child system prompt +17,000B, and turn_meta +1 line (~+20% each)
failed all three tests; reverted, all green.

Verification:
- cargo fmt --check -p codewhale-tui: clean
- cargo test -p codewhale-tui --bin codewhale-tui -- turn_meta_block_stays
  read_only_child_envelope parent_agent_surface: 4 passed; 0 failed
2026-08-02 09:13:34 -07:00
Hmbown 408d35b201 feat(workflow): experimental-search authoring boundary, reshaped and verified
Land the in-flight experimental-search slice as a real, honest v0.9.4
piece: a provider-neutral WorkflowSearchSpec authoring + freeze boundary
(parse/validate, preregistration hashes over baseline/requested+resolved
model/public evidence/evaluator, deterministic candidate ids and
admission batches) plus the operate best-of-N recipe's structured
'search' strategy (2-16 independent worktree candidates with
responseSchema contracts and a read-only judge). The module explicitly
remains an authoring boundary, not a runtime: hard_gates/score commands
are parsed and validated only, and docs say so.

Fixes found during the takeover operation:
- The checked-in recipe test failed against the real driver contract
  (parse_task_options lets prompt win over description, so fake-driver
  needles never matched and replies fell back to non-JSON). The recipe
  now puts the full instruction in the single driver-visible description
  and pins the prompt-wins contract with a new test.
- Queue claims verified against the runtime: the Workflow host's
  per-run concurrency gate (Semaphore, 16 live) is where larger
  populations wait; docs now name the gate instead of vague 'queues
  through Fleet'. WORKFLOW_SEARCH_MAX_CONCURRENT documents 16 as today's
  default with a cross-reference (a crate cycle prevents importing the
  host constant).
- TournamentOrdering (ScoreThenCost) and the 1,000-agent validation
  test bump retained from the slice.

Verified: cargo test -p codewhale-workflow -p codewhale-workflow-js
--locked green (250 + 16 + 9 + 49).

(cherry picked from commit f3e3232ef2)
Signed-off-by: Hmbown <101357273+Hmbown@users.noreply.github.com>
2026-08-01 10:11:57 -07:00
Hmbown 888a00bb2e refactor(tools): finish canonical action cutover
Remove the remaining RLM and Work compatibility registrations, route bang-shell execution through Bash, and migrate engine, Fleet, workflow, and PTY fixtures to canonical action calls. Preserve apply_patch for the DeepSeek Responses custom-tool contract and teach repository-law enforcement to classify canonical File mutations.
2026-07-31 02:23:14 -07:00
Hunter Bown 5d377294d8 chore(workflows): delete the seven v0.8.68 lane scripts (#4793)
* chore(workflows): delete the seven v0.8.68 lane scripts

v0868_catalog_lane, v0868_issue_implement, v0868_issue_sweep,
v0868_release_gate, v0868_stopship_lane, v0868_tui_copy_lane, and
v0868_workflow_ui_lane are pinned to v0.8.68 issue numbers that are closed.
They were the first-generation workflow scripts, written while we were still
learning the shape from grok-build. The generic replacements they taught us to
write already ship: operate_best_of_n, operate_parallel_scout,
operate_read_audit, operate_staged_fix, stopship, issue_audit.

Per docs/AGENT_ETHOS.md a workflow script is a diff, not intent. The intent of
each lane is preserved in its closed issues; keeping version-pinned scripts is
the same habit that produced 445 branches.

Six had no inbound references. The seventh did:
short_workflow_names_do_not_resolve_historical_v0868_files required
workflows/v0868_issue_sweep.workflow.js to exist on disk, so deleting it alone
would have failed cargo test -p codewhale-cli. That test covers two behaviors
and only one was v0868-specific, so it keeps the guard that a bare short name
never expands to a version-pinned script, and checks explicit-path resolution
against stopship.workflow.js instead. Renamed to match what it now asserts.

cargo test -p codewhale-cli: 169 passed, 0 failed.

* style(cli): cargo fmt the workflow path resolution test
2026-07-25 19:11:21 -05:00
Hunter B f6be7baa02 fix(operate): keep starter synthesizers read-only
type "general" maps to a write-capable worker and fails closed without
writeRoots/exactFiles/coordinationContracts. operate_read_audit and
operate_parallel_scout only synthesize scout output — use type "review"
so the starters complete under Operate dogfood.
2026-07-24 01:23:32 -07:00
Hunter B 65f9c8dde8 feat(operate): Phase 1 doctrine, verify contract, starters, best-of-n
Rewrite OPERATE_MODE into hard conductor doctrine (goal → dispatch →
background → verify → synthesize). Dispatching sub-agents is the default
multitask path — no /multitask verb. Write-capable children get a spawn-time
VERDICT PASS/FAIL evidence contract; the agent tool description prefers
implementer/verifier pairs and worktrees. Ship operate_* starter workflows
and strengthen the best-of-n skill so winners apply only after PASS.
2026-07-24 00:41:08 -07:00
Hunter B 32cabb295b test(workflow): preserve stopship evidence scope
Keep every acceptance role on the same five-file source boundary and carry all seven runtime owners through each promoted handoff. Pair the Workflow completion constructor with its completed-path assertion so a live reviewer can distinguish source emission from terminal proof.
2026-07-16 04:05:43 -07:00
Hunter B d2090a99de test(workflow): carry Lane exit evidence end to end
Add the tmux process-exit reconciliation owner to the bounded scout query and require every downstream receipt to distinguish Workflow completion from Lane reconciliation. Lock the five-file, seven-owner contract into fixture tests.
2026-07-16 03:57:46 -07:00
Hunter B fb15e5fec8 fix(workflow): fail closed on terminal gates
Propagate a terminal blocking gate into the workflow run result instead of accepting a successful VM return.

Add the release-lead final receipt to the stopship fixture, constrain scout evidence to the exact four source files, and reject placeholder-only gate artifacts with focused regressions.
2026-07-16 03:51:05 -07:00
Hunter B b4647698c6 test(workflow): make complete scout evidence approve
Tell the bounded release scout to follow its six-owner decision rule literally and reject only artifacts that name an actual missing owner. Lock the contract into the JavaScript authoring fixture test.
2026-07-16 03:30:09 -07:00
Hunter B 012e559948 test(workflow): leave workflow identity to host receipts
Keep the scout focused on runtime source owners while the already-typed run_started event remains authoritative for the compiled workflow id and source path.
2026-07-16 03:25:46 -07:00
Hunter B 5985c6ac16 test(workflow): use high-signal stopship evidence grep
Remove generic field names that exhausted the scout result cap and keep the single discovery round bounded to unique release-orchestration owners.
2026-07-16 03:23:12 -07:00
Hunter B fc7f1fec63 test(workflow): collapse scout discovery to one grep
Use one exact-symbol, bounded repository grep for stopship source evidence so model providers cannot serialize per-file searches into an exhausted response budget.
2026-07-16 03:21:20 -07:00
Hunter B 4ce985ad42 fix(workflow): require substantive gate artifacts
Fail closed when an explicit approval would promote an empty declared artifact, and require every tool-free stopship consumer to carry concrete source evidence into its next handoff.
2026-07-16 03:18:35 -07:00
Hunter B d39966cc77 fix(workflow): make stopship handoff consumers tool-free
Add an explicit deny-all tool posture for declarative leaves and use it after the scout so stopship roles review promoted evidence instead of reopening source discovery until their step caps.
2026-07-16 03:13:25 -07:00
Hunter B 36203e7735 fix(workflow): reserve token-neutral verdict steps
Give each bounded stopship role a small response reserve for the required terminal verdict while keeping all token and wall-time ceilings unchanged at a 360k aggregate cap.
2026-07-16 03:07:40 -07:00
Hunter B 4eeab59e11 test(workflow): forbid stopship verdict preambles
Make every stopship role begin its final response with the host-readable verdict token and lock the anti-preamble instruction into the checked-in fixture contract.
2026-07-16 02:54:59 -07:00
Hunter B 6e027ea094 test(workflow): reserve stopship verdict turns
Constrain each live acceptance role to exact-file retrieval rounds and a final no-tool verdict within its authored model-turn cap. Keep the existing fail-closed token budget while preventing broad search fan-out from consuming every response before APPROVE or BLOCK.
2026-07-16 02:34:17 -07:00
Hunter B 29d3f0c321 release: prepare Codewhale v0.9.0
Integrate the underwater TUI, message-first Operate, Fleet and Workflow reliability, expanded model/provider catalog, exact custom-route restoration, docs-first site, localization, packaging, and release metadata for the v0.9.0 candidate.

Harden endpoint-bound credential provenance, approval and goal UX, Fleet attempt fencing and crash recovery, large-workspace mention discovery, Kimi budgeting, and release asset/version gates. Include the stopship Fleet and Workflow fixtures used by release dogfood.

Verified with workspace fmt/check/clippy/tests on Rust 1.88, release-script and npm suites, 18-crate publish dry run, production web build, Docker build check, secret scan, dependency audit, and protected-state hash validation.
2026-07-15 23:44:37 -07:00
Hunter B 122bc0c462 fix(workflow): right-size stopship fixture budgets
Base each role cap on the 17.5k-token live first-turn envelope plus bounded per-turn headroom. Reduce the step ceilings, document the 360k aggregate/shared limit, and lock the contract into the JavaScript authoring regression.
2026-07-15 00:26:54 -07:00
Hunter B 75b46e20da fix(workflow): fail closed acceptance contracts
Add an opt-in gate contract that requires a standalone first-line verdict and blocks missing or malformed responses without changing legacy pass-on-success gates. Apply it to every v0.8.68 acceptance handoff.

Keep role-only Fleet leaves type-free while preserving authored non-General types so compatible overrides remain visible and conflicts still fail before provider dispatch.

Tests: cargo test -p codewhale-workflow --lib --locked

Tests: focused codewhale-tui verdict, role-only Fleet, and stopship fixture tests
2026-07-14 14:35:00 -07:00
Hunter B 370e61c257 fix(workflow): bound stopship acceptance reads
Make every acceptance role return an exact first-line APPROVE or BLOCK verdict, direct source-reading children to grep before bounded snippets, and replace the unverified budget inflation with explicit per-role caps. Structural and mock receipt tests now enforce the prompt and budget contract; live provider completion remains unverified.\n\nTests: cargo test -p codewhale-workflow --lib --locked stopship_acceptance_fixture_is_read_only_and_gate_complete -- --nocapture\nTests: cargo test -p codewhale-tui --bin codewhale-tui --locked stopship_acceptance_fixture_emits_role_gate_and_terminal_receipts -- --nocapture
2026-07-14 14:35:00 -07:00
Hunter B e71d718828 fix(workflow): budget live acceptance children
The first real tmux run reached the scout Fleet role but exhausted the 6k child budget before completing its source inspection. Raise the bounded per-role token caps enough to cover the runtime prompt and read-only evidence pass, and lock the minimum into the fixture contract test.
2026-07-14 14:35:00 -07:00
Hunter B 4405daaacb fix(workflow): make stopship acceptance lane read-only
Replace the stale closed-issue fix workflow with a five-role, no-edit acceptance chain and explicit Workflow-owned gates. Allow a Fleet implementer profile to be narrowed to read-only tools, keep custom Fleet roles compatible with general profiles, and remove the unroled reducer that made named-Fleet runs fail after all children completed.\n\nAdd fixture-level contract coverage plus an exact mock runtime test for role/profile, gate, and terminal receipts, and refresh the v0.8.68 playbook with the disposable-workspace command.
2026-07-14 14:35:00 -07:00
Hunter B 11ee494b52 fix(workflow): use declarative read_write mode and valid verifier posture
Align checked-in v0.8.68 workflow fixtures with the typed TaskMode schema. Keep the dogfood verifier read-only so Fleet validation can reach runtime execution.
2026-07-09 18:06:22 -07:00
Hunter B 2b96927364 feat(workflow): add lane-backed workflow run
Add a workflow run CLI entrypoint that validates a checked-in workflow and named fleet, then starts a Runtime-backed Lane using the existing headless Workflow tool path. Wire named fleet role maps into the TUI Workflow driver so task({ role }) resolves to the fleet-selected profile before sub-agent spawn. Update the stopship dogfood workflow to declare roles and refresh the playbook target command.
2026-07-09 03:28:53 -07:00
Hunter B 43ccbcffe7 feat(stopship): fleet-backed dogfood path for #4178
Add fleets/v0868-stopship.toml (five roles), NamedFleet loader with
resolution tests, profile bindings on stopship workflow steps, and
playbook commands for lane + interim exec paths.
2026-07-09 02:13:34 -07:00
Hunter Bown 9a74825cd1 feat(workflows): add v0.8.68 agent execution lanes and playbook (#4163)
Add wave-based Workflow JS files for stopship, catalog, workflow UI,
TUI copy, release gate, and per-issue implementation. Include agent
playbook, milestone label sync action, and update agent-task template.
Document main as v0.8.68 source of truth and defer v0.8.69 refactors
until stopship (#4090, #4093, #4094) is green.

Co-authored-by: CodeWhale Agent <codewhale-agent@hmbown.local>
2026-07-07 18:03:22 -05:00
Hunter B d6da71bbde Rename public Workflow surfaces 2026-07-05 14:42:42 -07:00
Hunter B 5cc2f5b63d wip(v0.8.67): fleet roster + whaleflow-js cutover checkpoint
Safety checkpoint of multi-agent cutover work (fleet roster core,
whaleflow-js runtime, /fleet roster view, audit fix lanes). Tree may
not compile: the agent-tool profile edit in tools/subagent/mod.rs was
interrupted mid-edit (credit exhaustion). Checkpoint precedes repair.
2026-07-05 10:02:37 -07:00
Hunter B 38ce04790a feat(whaleflow): add declarative JS workflow authoring
Adds a compile-only JavaScript/TypeScript authoring path that extracts a JSON-compatible workflow({...}) object, lowers it to the existing WorkflowSpec IR, and runs the Rust validation gate before execution.

Includes a branch/reduce .workflow.js example and a short authoring design note comparing YAML/JSON, Starlark, JavaScript, and TypeScript. The compiler rejects effectful JavaScript constructs instead of executing workflow source as a second runtime.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 08:15:14 -07:00
Hunter Bown e5974aa850 feat(whaleflow): run dogfood workflow with mock executor (#2831) 2026-06-05 22:17:02 -07:00
Hunter Bown 38a0d551ca feat(whaleflow): add Starlark compile gate
Add a fail-closed Starlark authoring layer that compiles workflow files into WorkflowSpec without exposing runtime execution. Include ctx.* repair aliases, unsupported-construct rejection, and rlm_cache_change / issue_fix_tournament examples.

Refs #2670.
Preserves WhaleFlow direction credit for @AdityaVG13 in changelogs and PR notes.
2026-06-05 21:35:05 -07:00