Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,26 @@ state directory. Start authorizes one tools-off provider request. TORQ writes th
returned UTF-8 contents to a separate candidate, then runs the fixed
`structural-v1` check for Python syntax, strict JSON, and UTF-8 text. The policy
accepts at most 32 files, 64 KiB per file, and 2 MiB total. It does not run unit
tests, execute generated code, or modify the configured project. Candidate
application remains a later governed step.
tests or execute generated code. Building a candidate leaves the configured
project unchanged.

Open **Review candidate** to inspect its Plan, exact Changes, and signed Checks.
Request a correction to build a separate child candidate, or **Accept reviewed
candidate** to record approval without changing files. **Apply to project** is a
separate action that writes only those approved contents. After application,
**Continue after apply** opens a fresh task draft from the current source.
History remains readable after the project changes.

Application supports UTF-8 file creation and replacement in existing directories.
It verifies source freshness and file identity, preserves supported permissions,
and rejects unsafe links or unsupported metadata. An interrupted application
blocks new work on that project until verified recovery completes; ambiguous or
externally changed files remain blocked rather than being overwritten. These
actions do not commit, push, merge, or run project tests.

Pause other editors, autosave, formatters, and tools writing this project during
Apply or recovery. TORQ serializes its own installations and rejects observed
file changes, but cannot prevent an external write racing the final file rename.

## Safety model

Expand Down
65 changes: 65 additions & 0 deletions docs/plans/2026-09-16-dashboard-p3-builder-handoff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Dashboard P3 builder handoff

Status: **IMPLEMENTED — READY FOR FINAL PACKAGE AND G1D VERIFICATION**

This implementation delivers the bounded P3 contract approved in
`2026-09-16-dashboard-p3-g1r-review.md`. It preserves P2 candidate creation and
adds artifact-backed review, readable exact-byte changes and check results,
immutable correction and continuation tasks, bounded searchable history,
separate signed acceptance, and an explicit evidence-backed Apply transaction.

Apply remains candidate-only until the user accepts and applies a verified
candidate. It never invokes a provider. It uses anchored filesystem access,
per-user/host exclusion, signed staged identities, a shared pending marker, and
restart recovery. P3 does not claim a portable destination compare-and-swap:
external editors and other non-TORQ writers must pause writes and atomic saves
during Apply. All checks immediately before and after the rename remain in
place, and observed drift fails closed.

## Main implementation

- `src/torq_cli/domain/task_review.py`: sealed historical candidate resolver,
exact artifact and lineage validation, complete byte-aware diff projection.
- `src/torq_cli/domain/candidate_decision_evidence.py`: closed semantic review
and Apply lifecycles, including forward and rollback staged identities.
- `src/torq_cli/application/review_store.py`: durable versioned request/index
store with CAS and no-follow bounded reads.
- `src/torq_cli/application/candidate_review.py`: review, correction, immutable
child tasks, continuation, accept/apply replay, eligibility, and recovery.
- `src/torq_cli/safety/primary_transaction.py` and `primary_marker.py`: anchored
POSIX/Windows primary transactions, semantic metadata preservation, staging,
leases, markers, and recovery primitives.
- `src/torq_cli/interfaces/fleet_http.py`, `interfaces/cli.py`, and Fleet assets:
authenticated closed HTTP routes plus the full-height Plan/Changes/Checks,
correction, acceptance, Apply, recovery, and paginated history UI.
- Candidate task/store, receipt, and evidence modules carry the minimal P3
lineage, stable chronology, semantic validation, and authenticated-prefix
support while preserving the P2 schemas and evidence.

## Durable regressions

Repository tests cover exact resolver and evidence schemas, authenticated HTTP
and replay, task history, platform-native transaction behavior, source
unchanged before Apply, signed acceptance/application, correction child tasks,
stale continuation plans, continuation process-death reconstruction, a CAS race
with an ordinary draft, and restart after a native rollback rename before its
restored receipt. The rollback test proves exact base restoration, marker
clearance, idempotent idle recovery, and no extra provider/check launches.

Independent fixtures additionally exercised all ten forward crash boundaries,
unsigned and substituted staging files, third-byte conflicts, source-context
drift, legacy P2 evidence compatibility, replay-store substitution, and real
process death during rollback. Those results are recorded in
`2026-09-16-dashboard-p3-g1d-verification.md`.

## Builder verification

- `python -m pytest -q -p no:cacheprovider --basetemp E:\tmp\torq-p3-builder-final-focus tests/test_candidate_review.py tests/test_candidate_decision_evidence.py tests/test_primary_transaction.py tests/test_task_http.py tests/test_candidate_history.py tests/test_hermetic.py` — **56 passed**.
- `python -m ruff check src tests` — **passed**.
- `python -m mypy --platform win32 --cache-dir tmp/mypy-p3-final-win32 src/torq_cli` — **passed, 96 source files**.
- `python -m mypy --platform linux --cache-dir tmp/mypy-p3-final-linux src/torq_cli` — **passed, 96 source files**.
- `python -m mypy --platform darwin --cache-dir tmp/mypy-p3-final-darwin src/torq_cli` — **passed, 96 source files**.

The independent G2A verdict is **APPROVE** in
`2026-09-16-dashboard-p3-g2a-review.md`. Packaging, installed-wheel browser
verification, and delivery remain with G1D/root.
Loading
Loading