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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Security and behavior changes

## Unreleased — bounded context reuse and review efficiency

- Reuse verified source without spending another distinct-path lookup; separate 24 uncached snapshot/path lookups from a hard 100 total context-request cap. Preserve all GitHub API, byte, integrity, authorization and inference limits. Missing evidence and resource exhaustion remain non-approving, with fixed error reasons.
- Avoid retransmitting full modified old files alongside complete patches/current source; all base/head files remain independently hash-verified and available read-only.
- Stop subsequent groups/synthesis after unrecoverable required/visual-context or output-loss reports, preserving validated findings without additional inference. Soft continuations and complete cross-group synthesis retain their existing checks.
- Preserve host context failure flags/counters alongside the primary execution failure. Identify the unchanged 20-minute timeout as execution-wide; never log paths, source, prompts or credentials in these diagnostics.


## 0.1.1 — review execution and bounded orchestration

### Responses output schema compatibility
Expand Down
14 changes: 11 additions & 3 deletions docs/adaptive-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Bounded review orchestration

After collection passes, the trusted Actions host writes a private `review-plan.json` and immutable `review-units/` inputs. Changed paths are sorted to keep nearby code together, then grouped within 16 files / 2 MB per input, at most 32 groups. Inputs contain the actual textual patches and complete collected base/head changed-file text, or SHA-bound verified PNG metadata, plus applicable trusted instructions, the whole-PR path overview and an inventory of shared collected source. Every group keeps access to all original source, callers, dependencies, the file index and the same bounded context socket; grouping never removes cross-file context. Trusted instruction input is bounded to 1 MB; unrepresentable essential evidence fails before inference. Original Git/snapshot and binary verification remain required.
After collection passes, the trusted Actions host writes a private `review-plan.json` and immutable `review-units/` inputs. Changed paths are sorted to keep nearby code together, then grouped within 16 files / 2 MB per input, at most 32 groups. Inputs contain the actual textual patches and complete current/deleted changed-file text and hash receipts for every collected base/head file; modified old source remains read-only at its verified path instead of being retransmitted, or SHA-bound verified PNG metadata, plus applicable trusted instructions, the whole-PR path overview and an inventory of shared collected source. Every group keeps access to all original source, callers, dependencies, the file index and the same bounded context socket; grouping never removes cross-file context. Trusted instruction input is bounded to 1 MB; unrepresentable essential evidence fails before inference. Original Git/snapshot and binary verification remain required.

The orchestrator is immutable application code, not a model-provided plan. It checks hashes of host-prepared inputs and referenced text/image files before delivery. The actual pinned app-server processes groups sequentially in one ephemeral thread, with one required successful inspection command per turn and matching thread/turn identity. It allows at most two targeted continuations **across the whole review**, including synthesis. Explicit missing mandatory or visual evidence cannot be cleared by a later model claim. For multiple groups, a separate final synthesis reconciles all unit results and cross-group behavior; it cannot waive unfinished units. A sole group instead receives an explicit final whole-PR/cross-file check in its own response, avoiding a redundant turn. Its verified evidence, inspection and completeness gates still apply. No model field such as “all groups inspected” controls scheduling or coverage.

Expand All @@ -16,7 +16,7 @@ The existing immutable collection and isolated Codex execution remain in place.

The collector writes `/workspace/file-index.json`: at most 12 nonrecursive directory walks and 5,000 regular-file paths. A partial supplementary index does not invalidate a small PR. It does not imply exhaustive semantic coverage. No full recursive tree or unrelated blob download is required.

A separate trusted host Unix socket at `/run/proxy/context.sock` accepts POST `/file` for required contents or `/probe` for optional existence, with JSON containing `snapshot: base|head` and a relative `path`. Successful retrieval materializes a verified file under the existing read-only reviewer mount. Paths, immutable commit/tree/blob identity, object modes, UTF-8, size and Git blob SHA are validated by the same collector. It cannot request another repository/ref, fetch URLs, follow symlinks or execute commands. There are at most 24 lookups, sharing the 768-call/16-MB-source/512-KB-file limits and SHA cache. Missing `/file` evidence makes the result incomplete and fails the review job. A `/probe` returns only `{exists: true|false}` from verified immutable tree metadata and never materializes source or satisfies content evidence. Verified absence is neutral; API/tree verification failures are errors and remain fail-closed, not false absence.
A separate trusted host Unix socket at `/run/proxy/context.sock` accepts POST `/file` for required contents or `/probe` for optional existence, with JSON containing `snapshot: base|head` and a relative `path`. Successful retrieval materializes a verified file under the existing read-only reviewer mount. Paths, immutable commit/tree/blob identity, object modes, UTF-8, size and Git blob SHA are validated by the same collector. It cannot request another repository/ref, fetch URLs, follow symlinks or execute commands. There are at most 24 distinct uncached snapshot/path lookups and 100 total socket requests, including cache hits and invalid input, sharing the 768-call/16-MB-source/512-KB-file limits and SHA cache. Missing `/file` evidence makes the result incomplete and fails the review job. A `/probe` returns only `{exists: true|false}` from verified immutable tree metadata and never materializes source or satisfies content evidence. Verified absence is neutral; API/tree verification failures are errors and remain fail-closed, not false absence.

The GitHub read token remains on the trusted host through bounded exploration, rather than being revoked before inference. It is never mounted into the reviewer or credential proxy. On completion/failure, the host aborts/drains outstanding lookups, closes the context service, revokes the token and removes temporary source. Token cleanup failure fails the review job; it does not authorize approval. The separate publisher still uses the job conclusion and exact commit to decide whether a safe COMMENT is appropriate.

Expand Down Expand Up @@ -52,7 +52,7 @@ The Docker acceptance uses the actual pinned Codex binary to prove PNG conversio
Final completion is checked again by the trusted host after the isolated engine returns and the context service is closed/drained. A missing file requested through `/file` remains essential missing evidence even if the model returns complete findings or has inspected every attached PNG. The host preserves validated findings in the non-approving submission, fails the review job and logs only completion booleans/result enum plus an approved context failure code. On-demand failures enter required coverage diagnostics rather than being labeled supplementary omissions. Paths, model text and credentials are not diagnostic fields. Neither a later successful lookup nor a complete model result clears a previous essential-evidence failure.


Optional discovery never uses a model-supplied required/optional flag. The existing `/file` endpoint stays mandatory and rejects extra fields such as `required: false`; the separate `/probe` operation supplies existence only, not readable or verified contents. A probe can report an object exists even when a later content read rejects its Git type, size or blob hash. A successful probe cannot waive initial changed-file/instruction/dependency requirements or clear a previous required failure. Both operations share the unchanged 24-request and GitHub API budgets. Exhausted optional probes fail without invalidating otherwise complete evidence; a denied required fetch remains fatal. There is no extra inference pass or model/budget change. Host checks do not claim to prove exhaustive model reasoning about every possible dependency.
Optional discovery never uses a model-supplied required/optional flag. The existing `/file` endpoint stays mandatory and rejects extra fields such as `required: false`; the separate `/probe` operation supplies existence only, not readable or verified contents. A probe can report an object exists even when a later content read rejects its Git type, size or blob hash. A successful probe cannot waive initial changed-file/instruction/dependency requirements or clear a previous required failure. Both operations share 24 distinct uncached snapshot/path lookups and 100 total requests; cached verified contents remain reusable after the distinct-path allowance is consumed. The original GitHub API and byte limits are unchanged. Exhausted optional probes fail without invalidating otherwise complete evidence; a denied required fetch remains fatal. There is no extra inference pass or model/budget change. Host checks do not claim to prove exhaustive model reasoning about every possible dependency.

## Runtime envelope and image retention

Expand All @@ -68,3 +68,11 @@ For G planned groups, successful baseline scheduling uses T = G + (G > 1 ? 1 : 0
The maximum plan leaves only 30 requests beyond that two-step/35-turn pattern and an arithmetic average of roughly 34 seconds per turn within 20 minutes, before startup overhead. There is no guaranteed large-PR completion or wall-clock/token cost estimate. Real models may need more inspection, compaction or reasoning; exhaustion produces a failed, non-approving partial review. Do not increase limits to hide this. A controlled rollout should first observe representative advisory/no-merge reviews and split work that does not fit the envelope.

The native acceptance now creates four different PNG pixel patterns and verifies four distinct Git blob identities and four distinct encoded image inputs on every request across groups, continuation and final synthesis (16 requests in the large/one-continuation fixture). The first-turn-only attachment behavior is supported by the tested pinned app-server history; image loss was not reproduced. The proxy additionally binds fingerprints of the first trusted required visual inputs and rejects subsequent loss, repetition-as-replacement or substitution. Distinct Git images can have identical native encodings (for example after lossy conversion); the guard retains the minimum attachment count and the first trusted fingerprint set rather than inventing a one-to-one Git-to-encoding identity. Fingerprints and image bytes never enter public diagnostics. No images are blindly reattached per turn, which would inflate history. Native context compaction/re-encoding behavior at real large input sizes remains unmeasured; loss of required evidence fails closed rather than authorizing approval.

## Context reuse and terminal failures

Read already supplied source directly before using the context socket. A probe and subsequent content request for the same immutable snapshot/path consume one distinct-path slot. Repeated verified content requests use the existing mount and hash-verified cache, never another repository, ref or credential. Total requests stay separately bounded, including invalid bodies; crossing that bound cancels context retrieval and makes the host result non-approving. New essential paths cannot bypass the distinct-path or API/byte/type/integrity limits.

Missing required files return a fixed context_path_missing reason; infrastructure, integrity, object-type and size failures are distinct fixed errors, never invented absence or raw exception text. Primary execution failures retain safe host completion flags and bounded lookup counts/code. The 20-minute deadline is explicitly identified as execution-wide; it and the 100-provider-request budget are unchanged.

A unit reporting unavailable required/visual evidence or truncated output ends further inference immediately, preserving validated partial summaries/findings as COMMENT with a failed job. It cannot be repaired by a later model completeness claim. Soft unfinished analysis still uses the existing shared continuation allowance. Complete multi-group reviews still require all groups and final synthesis.
2 changes: 1 addition & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ See [operations](operations.md), [security](security.md) and [acceptance](accept

Review execution uses a host-generated immutable coverage plan, bounded sequential app-server turns in one isolated thread and final cross-group synthesis. The host independently validates evidence receipts, coverage and final context/output completeness. Valid partial reviews survive as failed-job COMMENT results; neither partial findings nor a model assertion can authorize approval or merge. See [orchestration limits and acceptance](adaptive-context.md#bounded-review-orchestration).

The collector also writes a supplementary regular-file index (12 directories / 5,000 paths, no recursive tree dump). Explicit Python relative imports and Rust sibling modules join JS/TS dependencies; nearby Python/Go/Java test names are considered. A separate host Unix socket accepts bounded base/head `/file` requests for required contents and `/probe` requests for optional existence for this authorized immutable repository. It never forwards arbitrary URLs, executes project code or exposes credentials. At most 24 requests share the existing byte/blob/API limits and per-SHA cache. Required files that cannot be obtained invalidate completeness. A metadata-only probe may establish absence without fetching source; it cannot waive required evidence. Probe API/tree failures remain fail-closed rather than being mislabeled as missing paths. The reviewer mount stays read-only and network=none. The read token now lasts through bounded context exploration; shutdown cancels/drains lookups and revokes it before temporary source cleanup. Failed token cleanup fails the review job.
The collector also writes a supplementary regular-file index (12 directories / 5,000 paths, no recursive tree dump). Explicit Python relative imports and Rust sibling modules join JS/TS dependencies; nearby Python/Go/Java test names are considered. A separate host Unix socket accepts bounded base/head `/file` requests for required contents and `/probe` requests for optional existence for this authorized immutable repository. It never forwards arbitrary URLs, executes project code or exposes credentials. At most 24 distinct uncached snapshot/path lookups and 100 total requests share the existing byte/blob/API limits and per-SHA cache. Repeated verified files reuse existing evidence; total-request exhaustion cancels further retrieval and prevents approval. Required files that cannot be obtained invalidate completeness. A metadata-only probe may establish absence without fetching source; it cannot waive required evidence. Probe API/tree failures remain fail-closed rather than being mislabeled as missing paths. The reviewer mount stays read-only and network=none. The read token now lasts through bounded context exploration; shutdown cancels/drains lookups and revokes it before temporary source cleanup. Failed token cleanup fails the review job.

The system prompt asks for introduced, evidence-backed bugs traced through unchanged callers and dependencies, with trusted default-branch guidance subordinate to execution/output safety. Additional comment context is advisory. The model/effort CLI precedence is unchanged; a generated pinned-native catalog powers dashboard validation and distinguishes catalog membership from account entitlement.

Expand Down
Loading