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
107 changes: 107 additions & 0 deletions PLANS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,112 @@
# Execution Plans

## Active Plan: Toolkit 0.16.2 — incremental review efficiency, Runner compatibility and CI deduplication

plan_schema_version: 2
Status: active
Release classification: release-required
Target release: 0.16.2
Next development marker: 0.17.0
Last Updated: 2026-12-02

### Goal

Reduce repeated native OCR model work with verifiable incremental reuse, measure preparation and MCP costs, and qualify CI deduplication on protected PRs.

### Plan Origin

plan_mode_approved

### Requested Scope

Deliver [#368](https://github.com/xeonvs/open-code-review-toolkit/issues/368), [#364](https://github.com/xeonvs/open-code-review-toolkit/issues/364) and [#370](https://github.com/xeonvs/open-code-review-toolkit/issues/370) through one implementation draft targeting dev, then prepare the signed release PR.

### Requirement Traceability

| Requirement | Outcome | Queue | Status |
| --- | --- | --- | --- |
| REQ-001 | One linked implementation draft and milestone | WQ-01 | done |
| REQ-002 | Exact immutable read/search replay and native token measurements | WQ-02 | done |
| REQ-003 | Separate preflight, preparation and MCP measurements | WQ-03 | done |
| REQ-004 | Hosted CI qualification and resource cleanup | WQ-04 | done |
| REQ-006 | Restore review and posting for ordinary GitLab Runner checkouts with externalized Git configuration | WQ-06 | done |
| REQ-005 | Verified promotion, TestPyPI preview and signed release candidate | WQ-05 | pending |

### Explicit Non-Goals

Stable publication requires separate authorization. Workflow credentials and private review material stay outside test fixtures.

### Constraints

Reuse evidence for identical inputs and environments. Publish only synthetic cases and anonymous aggregates. Preserve existing replay budgets, DLP, attestation, fork isolation and required check identities.

### Inputs And Sources

[#368](https://github.com/xeonvs/open-code-review-toolkit/issues/368), [#364](https://github.com/xeonvs/open-code-review-toolkit/issues/364), [#370](https://github.com/xeonvs/open-code-review-toolkit/issues/370), the native qualification manifest, development and release guides, existing telemetry, provider check rules and [#366](https://github.com/xeonvs/open-code-review-toolkit/pull/366).

### User Decisions And Answers

Patch release 0.16.2, one draft to dev, and final cleanup. The maintainer subsequently waived the disposable hosted repository and fork exercise. Preserve the current required triggers and track the outstanding hosted proof in #364. Use the existing native executable for local qualification.

### Completed Baseline State

Protected dev incorporates the preceding release workflow repair. The reported token count is an observation from one review. Milestone v0.16.2 tracks the original two issues and the urgent Runner compatibility report.

### Current Work Queue

| Item | Work and exit evidence | Requirements | Status |
| --- | --- | --- | --- |
| WQ-01 | Push signed plan and create the linked draft. | REQ-001 | done |
| WQ-02 | Qualify UTF-8/line/body truncation and 99/100/101 matches, PCRE and exclusions. Compare baseline, repeat and control for usage, groups and expected finding. | REQ-002 | done |
| WQ-03 | Measure cold/warm preflight, preparation through first request, evidence construction and repeated query. Attribute time, RSS, Git work and bytes; optimize only measured costs. | REQ-003 | done |
| WQ-04 | Verify existing route evidence for fork, draft and advisory intervals. The maintainer waived the new remote fixture. Keep unqualified trigger changes pending in #364. | REQ-004 | done |
| WQ-06 | Qualify ordinary Runner-managed config includes in GitLab review and posting while retaining immutable coverage, ignored-path and credential boundaries. | REQ-006 | done |
| WQ-05 | Review each logical change and aggregate diff. Merge ready dev PR, promote dev, verify development publication, prepare release PR and request permission. | REQ-005 | pending |

### Locked Decisions

Observed native bytes and immutable dependencies determine reuse. Unknown outputs or unavailable proof cause a fresh review of the affected group. Gate changes to protected check behavior on hosted proof.

### Verification

Compare equivalent synthetic reviews with one controlled change. Report measured input/output/cached tokens and tool activity when available. Compare first and repeated requests on the same revision and verify evidence identity after optimization. Verify hosted merge eligibility and clean up before handoff.

### Latest Validation Results

2026-12-02: #369 opened as a draft with both issue links. Synthetic follow-up against the same revisions and model with filtering disabled used 41,390 input plus output tokens compared with 83,606 on the previous release, and retained the known finding. Default-filter candidate baseline and follow-up qualified and carried the same finding. Installed-path measurements used a local development adapter; released executable binding remains unchanged. The collector reduced full tree listings from five to two with identical evidence and bootstrap bytes. The local preflight and MCP measurements are reported separately in #368.

On the same synthetic MR range, review and post succeeded with and without a Runner include on 0.16.0. On 0.16.1 only the include case failed before OCR. With the correction, installed OCR reviewed the selected change and posting reported the tracked ignored file as incomplete coverage. The checkout config was unchanged. This used a local HTTPS forge fixture.

Existing protected fork and draft runs corroborate distinct Actions and CodeQL app checks. After required checks passed, two prior merges took 17 s and 23 s, including cases with pending advisory runners. Required workflow triggers remain unchanged. No remote test infrastructure was created.

### Risks And Recovery

Keep broad checks for uncertain CI events. Continue independent work when hosted access is unavailable. Use existing data first, isolate new model runs to synthetic fixtures, and remove temporary materials after retaining sanitized results.

### Resume Point

WQ-05: finish aggregate verification and obtain passing protected dev checks, then promote, verify TestPyPI and prepare the signed release PR. Keep #364 open for the outstanding hosted proof.

### Plan Fidelity Check

REQ-001 through REQ-006 cover the three issues, native and hosted acceptance, measurements, cleanup, promotion and the authorization boundary.

### Reconciliation Check

Use dev and the issue milestone as the development baseline. Keep open issues tracked through the release receipt.

### Closure Gate

Require applicable protected checks, completed qualification, measured results, cleanup, verified TestPyPI development artifacts and the signed release candidate.

### Post-Close Delivery

Stable publishing, tag, immutable Release, registry verification and issue closure follow explicit owner authorization.

### Handoff Notes

Preserve the exact reviewed commits and report unverified scenarios explicitly.

## Recently Completed

- [x] 2026-12-01: Completed Toolkit 0.16.1 — contributor intake and incremental review; [full archived plan](docs/engineering/execution_history/plans/2026-12-01-toolkit-0-16-1-contributor-intake-and-incremental-review.md).
Expand Down
1 change: 1 addition & 0 deletions changelog.d/368.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Qualify bounded truncated reads, capped searches, PCRE and supported exclusion pathspecs for local incremental review. Reuse unchanged groups after verifying the native-visible result against immutable Git inputs.
1 change: 1 addition & 0 deletions changelog.d/370.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Restore ordinary GitLab merge request reviews and posting on Runner checkouts with an external Git configuration include. Qualify the immutable diff using a private Git view that omits the external configuration and preserves tracked-file exclusion checks.
2 changes: 1 addition & 1 deletion docs/codex/ENGINEERING_WORKFLOW_STATE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ plan_archive_indexes:
- docs/engineering/execution_history/README.md
- docs/engineering/README.md
- docs/README.md
active_plan: null
active_plan: PLANS.md
runtime_agent_config_managed: true
instruction_contract_version: 3
planning_contract_version: 2
Expand Down
29 changes: 21 additions & 8 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,19 @@ coverage owner. CI omits the two advisory macOS jobs for positively classified
same-repository documentation-only pull requests and direct promotions from
`dev` to `main`. Direct promotions still run the Linux tests and coverage.
Manual runs, release-preparation pull requests, fork pull requests and uncertain
classifications retain the full matrix. Once required checks pass for the verified head and base,
an advisory job waiting for a runner can finish independently. Use a manual CI
run to check macOS on a deferred change.
Inspect any reported product regression before promotion. Report runner capacity
separately from test failures and retry only the affected job when appropriate.
classifications retain the full matrix. Once required checks pass for the
verified head and base, an advisory job waiting for a runner can finish
independently. Use a manual CI run to check macOS on a deferred change. Inspect
any reported product regression before promotion and retry only the affected job
when appropriate.

When measuring CI latency, identify the required checks and their source apps
from the target branch ruleset. Measure the interval from the last required
success to the PR merge. Report that interval separately from runner time and
advisory queue time. A job that never received a runner contributes zero runner
time. An advisory cancellation can leave the workflow run marked failed even
when all required checks passed.

Bandit scans only the supported runtime package
at medium-or-higher severity and confidence; tests and synthetic fixtures are
outside that bounded gate.
Expand All @@ -69,9 +77,14 @@ reopening it, updating its head, or editing its base starts checks for the
current GitHub test merge. Converting it to draft cancels in-progress review
CI on that pull request and uses the draft jobs. Manual and scheduled job
names also differ from the ready pull request contexts. Keep the existing
ready jobs required and confirm the successful jobs for the current candidate
and target before merging. See the [protected release path](release.md#stable-release)
for the additional release authorization.
ready jobs required and confirm the successful checks for the current candidate
and target before merging. GitHub Actions reports `analyze-python` and the code
scanning app reports the separate required `CodeQL` result. Finalize the title
and body while the PR is a draft. GitHub sends title, body and base changes as
`edited` events, and the required workflows listen for them to validate
retargeting. Metadata edits after readiness can restart checks for the same
test merge. See the [protected release path](release.md#stable-release) for the
additional release authorization.

Runtime code must remain compatible with the Python range and runtime dependencies declared in `pyproject.toml`; `uv.lock` owns the resolved dependency set. Tests must use synthetic data; public examples must use safe placeholder hosts and credentials while describing the real operating behavior rather than labelling the feature itself as synthetic. User-visible changes require a fragment in `changelog.d/`.
Repository-only qualification tools and evidence live under `scripts/` and `compatibility/`; they are excluded from both published distributions. Validate the manifest with `PYTHONPATH=src python scripts/ocr_compat.py validate`.
Expand Down
17 changes: 12 additions & 5 deletions docs/gitlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,18 @@ publication: a missing receipt stays in the job and cannot publish findings or
replace the previous review. A present v9-v13 receipt remains readable for
historical diagnostics but blocks a new current MR publication.

The GitLab checkout must contain a direct `.git` directory so the toolkit can
bind the selection rules used by preview and production. A linked worktree or
an external Git configuration include stops the review before OCR runs. The
ordinary projection accepts regular files. Changed symlink entries and
unsupported Git file-type transitions also stop before OCR.
For ordinary merge requests, a direct GitLab Runner checkout can use an
unconditional `include.path` in `.git/config`. Review and posting each
construct a private Git view from the reviewed commit and local objects.
The generated config preserves the direct `core.ignoreCase` setting and
omits the external file, credential helpers and URL rewrites. Tracked ignored
files still require verifiable exclusion evidence before publication.

Use a direct `.git` directory. Conditional includes, separate worktree
configuration and alternate object stores are unsupported on this isolated
route. A change to a submodule pointer uses the separate gitlink qualification
path. The ordinary projection accepts regular files; changed symlinks and
unsupported file-type transitions stop before OCR.

The provider validates same-project ownership, the current MR diff base/start/head/version, source H, actual target branch/T/protection, and selected policy branch/P/protection before OCR. Missing, pending, malformed, or contradictory diff data is unavailable or stale, not an empty review; a valid empty delta is a normal no-change case. `ocr-ci review` collects immutable evidence from actual code revisions, admits context under the selected policy capability, applies DLP and budgets, binds every immutable changed path to OCR's selected/excluded partition, runs OCR once, reconciles federation, validates the result, cleans private state, and attaches the ordinary receipt. `ocr-ci post` hostile-reads that receipt and independently checks the supplied selection against the Git diff; it rejects another `CI_JOB_ID` in a current-review result or preview/setup status when present. A successful result covers this MR only: no parent-MR lookup, chain review, integration claim, extra pipeline trigger, or merge is performed. Arbitrary valid branch names and a target with no parent MR are supported.

Expand Down
20 changes: 13 additions & 7 deletions docs/local.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,19 @@ source semantics or changes to shared selection, context, rules or model
can require a full review.

A direct source read can qualify when the toolkit verifies its result against
an immutable file and the file remains unchanged. This includes a verified
request for a line range beyond the end of the file. The toolkit can repeat
bounded literal `code_search`, `file_find`, `file_read_diff` and built-in
evidence queries over the new inputs. The group qualifies when every replay
produces the same complete result. Changed results, incomplete evidence
pages and ambiguous or unsupported tool requests require fresh review for
that group. Groups newly reviewed in a narrowed run need fresh review again
an immutable file and the file remains unchanged. This covers reads past EOF
and native reads limited by line count, line length or rendered bytes. The
verification includes the visible UTF-8 text, range, line addresses and
omission notices. An edit in a hidden part of the read file requires fresh
review of the dependent group.

The toolkit repeats bounded `code_search`, `file_find`, `file_read_diff` and
built-in evidence queries on the new inputs. For a capped native code search it
compares the first 100 matches, their order and the matching-file count.
Supported searches include literal and PCRE patterns and bounded
`:(exclude)` file patterns. A changed visible result, an unsupported pathspec,
a search that exceeds resource limits, or an incomplete evidence page calls
for fresh review of that group. Groups newly reviewed in a narrowed run need fresh review again
because OCR gave them a shorter comparison inventory.
Dependency verification uses locally available Git objects before OCR runs.
The report's native tool counters describe calls made by the fresh OCR
Expand Down
2 changes: 1 addition & 1 deletion docs/review-decision-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ flowchart TD
gitlink_scope -- Yes --> gitlink_projection[Freeze original trees, ordinary diff,<br/>Git inputs and child overrides]
gitlink_projection --> preview[Run exact OCR preview with<br/>toolkit-owned child environment]
gitlink_check -- No, local --> preview
gitlink_check -- No, GitLab --> ordinary_projection[Freeze immutable ordinary diff<br/>and Git selection inputs]
gitlink_check -- No, GitLab --> ordinary_projection[Freeze immutable ordinary diff and Git inputs;<br/>isolate unconditional Runner include]
ordinary_projection --> preview
preview --> preview_ok{Preview accepted and applicable<br/>Git partition verified?}
preview_ok -- Unclassified diagnostics --> preview_unclassified[Closed stage/count status;<br/>model not started]
Expand Down
22 changes: 22 additions & 0 deletions docs/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,28 @@ automatic approval while preserving publication of the safely reviewed subset.
Any reused native work blocks a new automatic GitLab approval and preserves
prior finding threads.

GitLab Runner may externalize checkout credentials and Git settings through an
unconditional `include.path` in the direct checkout's local config. Runner
owns that configuration. Its settings grant no authority to select fewer files
for review, mark a partial review complete, or publish configuration values.
For an ordinary GitLab MR in this layout, preview and native review use a
private Git directory with HEAD and index derived from the reviewed commit.
The view uses local objects, disables Git transports and lazy fetches, and
imports only the direct case-sensitivity setting and bounded checkout metadata
for attributes, exclusions and shallow history. The external config is outside
this projection. This boundary governs Git selection; the Runner and the OS
account executing the job remain trusted.

Review checks the projection again after OCR returns. Before a GitLab write,
posting independently reconstructs selection and checks coverage. Missing
proof stops publication; a proven exclusion blocks automatic approval.
Conditional includes and changed gitlinks retain their separate restrictions.
When hardening expands a check to another MR type, qualify both ordinary Runner
layouts (with and without an include) through review and posting. Include a
tracked, ignored change so the test observes partial coverage as well as a
successful review. This guards against denying routine reviews or silently
approving work that OCR skipped.

Changed Git submodule pointers are a separate repository-coverage boundary.
For an exact capability-qualified OCR version, the toolkit compares complete before/after Git
trees, the explicit unfiltered diff, and the ordinary-file projection before
Expand Down
Loading
Loading