Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
a756f5b
docs: reconcile the design plan with the code
mchwang Sep 26, 2026
a3605ae
docs: note merge-queue support in the guarded merge doc
mchwang Sep 26, 2026
f5b2f09
Run Ask in the lane D agent container
mchwang Sep 26, 2026
75dc270
Merge remote-tracking branch 'origin/main' into docs/reconcile-plan-w…
mchwang Sep 26, 2026
4c47bc7
docs: bring plan status up to date with F1 and H4a
mchwang Sep 26, 2026
6c6766c
Merge remote-tracking branch 'origin/docs/reconcile-plan-with-code' i…
mchwang Sep 26, 2026
ff1ebae
docs: add F1d and Ask PRs to lane status
mchwang Sep 26, 2026
ab15165
Align merge-queue wording with the merged K2/K3 support
mchwang Sep 26, 2026
a17fc7f
Merge remote-tracking branch 'origin/docs/reconcile-plan-with-code' i…
mchwang Sep 26, 2026
418cd48
Record the K-lane queue block as history in the task table
mchwang Sep 26, 2026
88e6d69
README: disclose that Ask runs the agent CLI on the host
mchwang Sep 26, 2026
e5e4f05
Add F1e (#60) and the #51 merge condition to the F lane row
mchwang Sep 26, 2026
93ceb06
Merge docs/reconcile-plan-with-code into ask-in-container
mchwang Sep 26, 2026
3acb93a
Bind Ask answers to their attempt and keep cleanup ownership
mchwang Sep 26, 2026
a20b78a
Run the Docker Ask suite when runner/questions.ts changes
mchwang Sep 26, 2026
6c488e8
Record Ask storage left at shutdown and keep Ask off until it is gone
mchwang Sep 26, 2026
33161c5
Keep Ask off after a setup failure that leaves unidentifiable storage
mchwang Sep 26, 2026
67f2231
Make the Ask leftover gate bounded and fail closed on unknown state
mchwang Sep 26, 2026
f46f50d
Bound Ask against unsettled lane D cleanup and scan all D labels
mchwang Sep 26, 2026
b5260f4
Own the host staging directory like the Docker allocation
mchwang Sep 26, 2026
2f7430a
Keep credentials out of setup subprocesses and settle abandon in order
mchwang Sep 26, 2026
404c360
Own every host copy through a recorded Ask root; fix CI env dependency
mchwang Sep 26, 2026
da64ab9
Delete an abandoned worker's root once its thread finally stops
mchwang Sep 26, 2026
127e431
Serialize Ask per review with a lock and bound the release timeout
mchwang Sep 26, 2026
18e8c40
Test that a refused second process cannot delete a live Ask root
mchwang Sep 26, 2026
f527d90
Give the Ask worker an allowlisted environment; credentials as data
mchwang Sep 26, 2026
47ac211
Use an OS lock for Ask and key it by the canonical database path
mchwang Sep 26, 2026
5bd567a
Clean up the Ask root when the worker cannot be constructed
mchwang Sep 26, 2026
1c81731
Serialize Ask worker abandonment and bound the host clone up front
mchwang Sep 26, 2026
ac12016
Never drop recorded Ask roots; keep the marker for unnamed resources
mchwang Sep 26, 2026
4027986
Make the Ask startup scan single-flight
mchwang Sep 26, 2026
2d262d3
Wait for an in-progress abandonment when the Ask worker closes
mchwang Sep 26, 2026
b4cea37
Key the Ask lock by file identity; finish the startup scan under it
mchwang Sep 26, 2026
b62cd0f
Find Ask roots by their owner stamp, not only through the record
mchwang Sep 26, 2026
90dedeb
Harden the Git size check and trust only codeboost lock stamps
mchwang Sep 26, 2026
5272273
Name the labels the Ask leftover scan actually checks
mchwang Sep 26, 2026
f30c2fa
Write the Ask leftover record through an exclusive random temp file
mchwang Sep 26, 2026
8f80412
Stop Ask admission when shutdown begins; keep the root if recording f…
mchwang Sep 26, 2026
0b173fa
Release the Ask lock when the final record write fails
mchwang Sep 26, 2026
6f047ac
Treat a failed worker termination as not stopped
mchwang Sep 26, 2026
63a11cf
Merge main into ask-in-container
mchwang Sep 27, 2026
c0b0976
Add AGENTS.md rules from the PR #54 review-lesson audit
mchwang Sep 27, 2026
dc8d3da
Close the store on failed Ask cleanup; private locks; keep lock after…
mchwang Sep 27, 2026
88bb96f
Pass the Ask stop reason as a typed value; leave foreign Ask folders …
mchwang Sep 27, 2026
ca6baff
Describe which Ask folders the orphan scan deletes
mchwang Sep 27, 2026
64ac028
Read the Ask record and owner stamps without following links
mchwang Sep 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/agent-isolation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ on:
- 'agents/**'
- 'git/clone.ts'
- 'test/agent-*.test.ts'
- 'runner/question-*.ts'
Comment thread
mchwang marked this conversation as resolved.
- 'runner/questions.ts'
- '.github/workflows/agent-isolation.yml'
pull_request:
paths:
- 'agents/**'
- 'git/clone.ts'
- 'test/agent-*.test.ts'
- 'runner/question-*.ts'
- 'runner/questions.ts'
- '.github/workflows/agent-isolation.yml'
permissions:
contents: read
Expand All @@ -29,4 +33,4 @@ jobs:
- run: npm ci --ignore-scripts
- run: npm run typecheck
# The Docker suites share one image tag and daemon, so run test files one at a time.
- run: npx vitest run --no-file-parallelism test/agent-contract.test.ts test/agent-clone.test.ts test/agent-container.test.ts test/agent-network.test.ts test/agent-policy.test.ts test/agent-proxy.test.ts test/agent-adapter.test.ts test/agent-supervisor.test.ts test/agent-output.test.ts test/agent-gate.test.ts
- run: npx vitest run --no-file-parallelism test/agent-contract.test.ts test/agent-clone.test.ts test/agent-container.test.ts test/agent-network.test.ts test/agent-policy.test.ts test/agent-proxy.test.ts test/agent-adapter.test.ts test/agent-supervisor.test.ts test/agent-output.test.ts test/agent-gate.test.ts test/agent-question.test.ts
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
- run: npm run typecheck
# The Docker agent suites run one file at a time in the Agent isolation workflow; running them here
# would put them in parallel against the same image tag and daemon.
- run: npm test -- --exclude test/agent-container.test.ts --exclude test/agent-network.test.ts --exclude test/agent-adapter.test.ts --exclude test/agent-supervisor.test.ts --exclude test/agent-gate.test.ts
- run: npm test -- --exclude test/agent-container.test.ts --exclude test/agent-network.test.ts --exclude test/agent-adapter.test.ts --exclude test/agent-supervisor.test.ts --exclude test/agent-gate.test.ts --exclude test/agent-question.test.ts
- run: npx playwright install --with-deps chromium
- run: npm run test:browser
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ Every reproduced race requires a failing-before and passing-after regression. As
- When an irreversible command has an ambiguous timeout, cancellation, transport, or unknown outcome, retain durable in-flight ownership and reconcile external state before enabling retry. Only a confirmed refusal may become retryable failure.
- Correlate retry observations to the current attempt with an immutable external identity or event boundary, and fail closed when multiple post-boundary action sequences appear. Matching only the resource or commit identity can replay another attempt's terminal event.

## Owned host and Docker resources

- Treat the cleanup handle of an external resource (container, volume, network, temporary directory) as owned state. If removal fails, keep the handle, record it durably before its in-memory owner can be dropped (shutdown, crash, abandon, restart), and fail closed until removal is confirmed. Never delete the durable evidence before the final release report has been saved.
- Give every subprocess an explicit allowlisted environment. Pass credentials only to the component that needs them, through a separate channel. Name-based scrubbing of an inherited environment is not isolation. Run Git with the repository's hardened invocation: no user or system config, no hooks, no lazy fetch, no network protocols.
- Treat paths read from a durable record or discovered on disk as untrusted. Before deleting, opening or probing one, validate its exact location and name, not only its basename, and never follow a link to it. Keep files that other local users must not plant or swap, such as lock files, in a directory only the current user can write. Write durable records through a unique temporary file opened exclusively, and delete it if the write fails.
- Exclude other processes with an OS-level lock held for the owner's lifetime, keyed by the resource's stable identity rather than a path spelling. A PID liveness check never authorizes taking over a lock. Run shared one-time startup work single-flight under that lock, and keep the lock until the work has finished.

## Blinded experiments

- Keep experimental PRs as drafts with automated review disabled until the assigned human decision is recorded. An automated review invalidates reviewer blindness; replace the affected package rather than reusing it.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Review agent-made Git changes one plan item at a time. The approved plan lists each item's files and acceptance checks; the review engine shows which item produced each change and flags foreign or overlapping work.

**Status:** the plan/linking library, SQLite store, and local review screen are implemented. Run `npm run demo` and open its private local URL. Ask can invoke Claude Code or Codex for read-only answers; choose the provider in Settings. A configured GitHub review can merge only after the guarded exact-head gate passes. Automated rebasing, plan command execution, and code-writing agents are not implemented. The paired human review experiment was cancelled before results were recorded and no longer blocks roadmap work; optional future validation is tracked in [#19](https://github.com/codeabovelab/codeboost/issues/19).
**Status:** the plan/linking library, SQLite store, and local review screen are implemented. Run `npm run demo` and open its private local URL. Ask runs Claude Code or Codex inside the locked-down agent container for read-only answers; choose the provider in Settings. Ask needs Docker, plus `CLAUDE_CODE_OAUTH_TOKEN` (from `claude setup-token`) for Claude or a Codex `auth.json` (`CODEBOOST_CODEX_AUTH_FILE`, default `~/.codex/auth.json`). The first question builds the agent image, which can take a few minutes. A configured GitHub review can merge only after the guarded exact-head gate passes. The agent container, vendor-only network and Claude/Codex adapters are implemented ([agent isolation](docs/implementation/agent-isolation.md)); only Ask uses them so far. Automated rebasing, plan command execution, and code-writing agents are not implemented. The paired human review experiment was cancelled before results were recorded and no longer blocks roadmap work; optional future validation is tracked in [#19](https://github.com/codeabovelab/codeboost/issues/19).

## Development

Expand Down Expand Up @@ -69,6 +69,6 @@ Inputs such as `planText` and the ledger must come from the trusted runner. `run
- Ownership uses line diffs, not semantic inference. Within one replacement block, new lines inherit all affected owners conservatively. Function context comes from Git hunk headers, not an AST.
- The importer requires accurate typed base entries, stable plan identity, a selected issue, and a trusted checkout path-identity function. It rejects path traversal, Git metadata paths, and traversal through a listed file/symlink/submodule. Runtime symlink and write-scope enforcement belong to the future container/runner; plan validation alone is not a sandbox.
- Allowed commands restrict accidents, not hostile programs or changed scripts. Parsing returns argv and never executes it. An unlisted valid command is a warning and must not run until allowed.
- No code here claims container isolation, vendor-only network access, credential protection, or safe dependency installation. Those controls must be implemented before running code-writing agents. Question answering uses bounded supplied context in a separate temporary working directory, with command tools disabled. **Known limit:** Ask still runs the Claude Code or Codex CLI on your computer, not in the agent container, with your normal environment and your agent sign-in. A flaw in the CLI or a missed flag would therefore run with your account's access. This exception is accepted only for Ask, which gets bounded context and changes nothing; it ends when Ask moves into the container's read-only questions phase (lane F).
- Container isolation, vendor-only network access and credential handling are implemented by the lane D boundary (`agents/`), not by this library. Ask runs in that boundary in the read-only "questions" phase: it sees a clone of the reviewed head, supplied review context, and nothing else from your computer. Safe dependency installation is not implemented.

See [implementation decisions and evidence](docs/implementation/build-step-1.md) and the [plan format](docs/plan-format.md).
Loading
Loading