Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ab69188
fix(review): cite trusted path:line in GitHub 422 inline fallback
seonghobae Aug 13, 2026
e099c28
fix(review): persist 422 inline failures as overview receipts
seonghobae Aug 13, 2026
d37885d
fix(review): retry inline comments one at a time after batch 422
seonghobae Aug 13, 2026
154a33d
test(review): pin 422 fallback sentence in the Python helper
seonghobae Aug 13, 2026
dc261ff
fix(review): receipt only refused path:line after mixed 422 retry
seonghobae Aug 13, 2026
94ee03d
fix(review): keep each refused comment's own GitHub 422 phrase
seonghobae Aug 13, 2026
3f06fb8
fix(review): cap inline retry at 20 and list attached path:line
seonghobae Aug 13, 2026
68264f1
fix(review): drop off-hunk inline comments before GitHub POST
seonghobae Aug 13, 2026
050b2c9
fix(review): turn surviving suggested diffs into GitHub suggestions
seonghobae Aug 13, 2026
e8d6966
fix(review): set start_line on multi-line GitHub suggestions
seonghobae Aug 13, 2026
7009465
fix(review): list applyable suggestion ranges in overview receipts
seonghobae Aug 13, 2026
93c0afd
fix(review): distinguish leftover diff fences from applyable suggestions
seonghobae Aug 13, 2026
58d5b0a
fix(review): persist leftover suggested-diff text as a manual-edit block
seonghobae Aug 13, 2026
9aaaa4c
fix(review): remap leftover LEFT comments onto same-path RIGHT hunks
seonghobae Aug 13, 2026
8928bb5
fix(review): anchor remapped LEFT leftovers to the same @@ hunk
seonghobae Aug 13, 2026
9ebe7e0
fix(review): label remapped applyable ranges with LEFT origin
seonghobae Aug 13, 2026
cd5ca09
fix(review): keep start_line on remapped leftover 422 retries
seonghobae Aug 13, 2026
9facb23
fix(review): keep deferred leftover range and origin off applyable list
seonghobae Aug 13, 2026
776bb8d
fix(review): keep Manual edit when leftover fences are deferred
seonghobae Aug 13, 2026
46bf600
fix(review): list deferred leftover before Manual-edit excerpt
seonghobae Aug 13, 2026
06392ec
fix(review): omit leftover reason bullet after deferred prefix
seonghobae Aug 13, 2026
2e39a06
fix(review): omit leftover reason bullet inside deferred start-end
seonghobae Aug 13, 2026
b36d308
fix(review): emit one deferred leftover range for interior leftovers
seonghobae Aug 13, 2026
a06f7a4
fix(review): keep Manual-edit leftover inside trusted deferred range
seonghobae Aug 13, 2026
ff3a8fd
fix(review): keep CLI overview Manual-edit for interior leftovers
seonghobae Aug 13, 2026
9fa54ae
fix(review): omit LEFT leftover suggestion fences from applyable ranges
seonghobae Aug 13, 2026
63ce471
fix(review): omit applyable ranges that contain a leftover line
seonghobae Aug 13, 2026
1b1a231
fix(review): omit overlapping applyable ranges on leftover CLI
seonghobae Aug 13, 2026
d9dc77d
fix(review): omit leftover interiors from applyable write path
seonghobae Aug 13, 2026
e5690e4
fix(review): consume leftover path:start-end receipts
seonghobae Aug 13, 2026
beadb4e
fix(review): prefix leftover start-end once for interiors
seonghobae Aug 13, 2026
34c55b9
fix(review): prefer widest leftover range over nested range
seonghobae Aug 13, 2026
b2aa596
fix(review): sanitize leftover excerpts in overview
seonghobae Aug 13, 2026
7f14fd4
fix(review): strip leftover range interiors from posted suggestions
seonghobae Aug 13, 2026
6b78bc8
fix(coverage): accept only bounded relative requirement includes
seonghobae Aug 13, 2026
49b05ca
fix(review): omit leftover overview paths with comment closers
seonghobae Aug 13, 2026
2597a6f
fix(review): narrow 422, pass control_json, discover requirements/ci.txt
seonghobae Aug 13, 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
265 changes: 254 additions & 11 deletions .github/workflows/opencode-review-dispatch.yml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@

<!-- CWL-ENTRY -->
> **Agents: read the master context FIRST.** Before any work, read [`docs/CWL-MASTER-CONTEXT.md`](docs/CWL-MASTER-CONTEXT.md) (mission · naruon-as-platform + inter-component UML · cross-cutting disciplines · conventions · roadmap · current state), the live **GitHub Project #1** <https://github.com/orgs/ContextualWisdomLab/projects/1> (work/roadmap source of truth), the full spec **ContextualWisdomLab/naruon#974**, and operate the Project per [`docs/agent-github-project-protocol.md`](docs/agent-github-project-protocol.md). The repo/Project — not any private agent memory — is the source of truth.

Materialize accepts only exact SHA-256 pins or a bounded relative `-r` include (no `.`/`..`); a lone `--require-hashes` directive is not trust evidence. `base_hash_locks` discovers hash-pinned `requirements/*.txt` via `_is_candidate_lock_path`. See [`docs/doctoring/review-inline-comment-422-fallback.md`](docs/doctoring/review-inline-comment-422-fallback.md) and [`docs/doctoring/trusted-uv-lock-materialization.md`](docs/doctoring/trusted-uv-lock-materialization.md).
LEFT leftover suggestion fences are not applyable overview ranges.
Leftover Manual-edit excerpts strip HTML comment delimiters and metacharacters.
Failed-check diagnosis must pass `$control_json` to `build_inline_comment_failure_body`. Bare `422` substrings are not HTTP 422.

48 changes: 48 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Architecture — ContextualWisdomLab/.github

This repository is the organization-wide GitHub special repository: profile
page, central PR governance / required workflows, and Cloudflare IaC. It is
not naruon itself. naruon remains the email-workspace platform described in
`docs/CWL-MASTER-CONTEXT.md`.

```mermaid
flowchart LR
subgraph Buyers["Sibling products"]
NAR[naruon]
ORCH[contextual-orchestrator]
BAND[bandscope]
end
subgraph Central["This repo"]
REV[OpenCode / Noema review]
STRIX[Required Strix]
SCH[Merge / autofix schedulers]
end
Buyers --> REV
Buyers --> STRIX
REV --> SCH
STRIX --> SCH
```

## Bounded requirement includes (2026-08-14)

Coverage materialize treats a lone `--require-hashes` line as non-evidence.
Only exact SHA-256 package pins or a bounded relative `-r`/`--requirement`
include (`target == PurePosixPath.as_posix()`, no `.`/`..` parts, candidate
lock path only) enter the trusted image. Dotted includes such as
`./lock.txt` and `-r other-hashes.txt` stay outside the build context
(CWE-22; CWE-1288).

`base_hash_locks` discovers those candidates with `_is_candidate_lock_path`,
so a hash-pinned `requirements/ci.txt` is materialized even though its
file name is not `requirements*.txt`.

## Failed-check review publication (2026-08-14)

`run_failed_check_diagnosis` must pass the local `$control_json` into
`build_inline_comment_failure_body`. The helper requires that third
argument; a two-argument call under `set -u` aborts the publish step and
discards a valid REQUEST_CHANGES diagnosis. Inline-comment 422 retry
classifies HTTP 422 only from `HTTP 422` / `Unprocessable Entity` /
classified GitHub HTTP 422 JSON phrases, not a bare `422` substring
(CWE-1288). Decision record:
`docs/doctoring/review-inline-comment-422-fallback.md`.
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,43 @@ Semantic Versioning where the repository publishes a release.

### Fixed

- `run_failed_check_diagnosis` now passes the local `$control_json` into `build_inline_comment_failure_body`, so a valid REQUEST_CHANGES failed-check diagnosis is not discarded by `set -u` when the helper requires the third argument.
- `base_hash_locks` now discovers hash-pinned direct children such as `requirements/ci.txt` via `_is_candidate_lock_path`, not only `requirements*.txt` file names.
- Inline-comment 422 retry now recognizes HTTP 422 only from `HTTP 422` / `Unprocessable Entity` / classified GitHub HTTP 422 JSON phrases. A bare `422` in a SHA, issue number, or run URL no longer starts the 20-comment retry loop (CWE-1288).
- Materialized base Python locks only when every package line is an exact SHA-256 pin or a bounded relative `-r`/`--requirement` include. A lone `--require-hashes` directive, a dotted include such as `./lock.txt`, or `-r other-hashes.txt` no longer enters the trusted build context.
- Posted review JSON now strips closed GitHub ` ```suggestion ` fences whose range overlaps leftover `path:start-end` coverage, so leftover `example.py:5-7` cannot still offer a one-click apply on interior `example.py:6` (CWE-1288).
- Leftover Manual-edit excerpts now drop HTML comment delimiters and `<`, `>`, `&` before they enter the overview comment, so a leftover `-->` cannot close `<!-- opencode-review-overview -->` (CWE-116).
- The leftover heading now prefixes the widest leftover `path:start-end` when a nested leftover range such as `example.py:5-6` sits inside leftover `example.py:5-7`, so authors see one leftover range then Manual-edit excerpts.
- The leftover heading now prefixes one leftover `path:start-end` for leftover interiors of that range, so leftover `example.py:6` next to leftover `example.py:5-7` shows the range once then Manual-edit excerpts instead of two leftover reason bullets.
- Leftover receipts now accept `path:start-end` as well as `path:line`, so a leftover cannot-provide range such as `example.py:5-7` drops overlapping applyable interiors (`example.py:6` and `example.py:5-7`) instead of being ignored.
- The hunk-filter write path now omits applyable `path:start-end` rows from `--applyable-locations` when a leftover cannot-provide or LEFT line sits inside that range, so `applyable.txt` cannot list a one-click apply for the same span as leftover `example.py:6`.
- The leftover overview CLI now omits applyable `path:start-end` rows that contain a leftover cannot-provide or LEFT line, so `--leftover-diff-locations` plus `--applyable-locations` show Manual-edit instead of a one-click apply for the same span.
- Dropped applyable overview `path:start-end` rows when a leftover cannot-provide or LEFT line sits inside that range, so authors see the Manual-edit instead of a one-click apply for the same span.
- Stopped listing LEFT-side leftover GitHub suggestion fences as applyable ranges, because GitHub cannot apply a suggestion on the deleted side.
- Kept leftover Manual-edit excerpts on the overview CLI when `--leftover-diff-locations` sits inside a trusted `--deferred-locations` `path:start-end` even if that leftover line is not a trusted control finding.
- Kept leftover Manual-edit excerpts that sit inside a trusted deferred multi-line `path:start-end` even when that exact leftover line is not itself a trusted finding, so authors still see the deferred range then the Manual-edit.
- Grouped leftover Manual-edit excerpts that sit inside the same deferred multi-line `path:start-end` under one deferred range line, so authors do not see a repeated deferred prefix.
- Omitted the duplicate leftover reason bullet when a leftover line sits inside a deferred multi-line `path:start-end`, so authors see the deferred range then the Manual-edit excerpt.
- Omitted the duplicate leftover reason bullet when the leftover heading already prefixes a deferred range/origin for the same `path:line`, so authors see one deferred line then the Manual-edit excerpt.
- Listed a deferred leftover ahead of its Manual-edit excerpt in the leftover heading when the same `path:line` is both deferred and leftover, so authors see the unposted fence first.
- Kept both the leftover Manual-edit ` ```diff ` block and the deferred range/origin row when a cannot-provide or pure-deletion leftover sits past the 20-comment 422 retry cap, and still omitted those fences from applyable GitHub suggestions.
- Recorded leftover OpenCode comments past the 20-comment 422 retry cap as deferred overview ranges with their LEFT origin, and stopped listing them under applyable GitHub suggestions because those comments are never posted.
- Kept `start_line`/`start_side` on remapped leftover OpenCode suggestions when a batch 422 is retried one comment at a time, so a multi-line RIGHT range still posts as one GitHub suggestion.
- Labeled remapped leftover OpenCode applyable ranges with the original LEFT `path:line` so the overview shows `path:right` came from LEFT `path:left`.
- Anchored remapped leftover OpenCode LEFT comments to the first RIGHT line of the same `@@` hunk when the original line is gone, so multi-hunk files do not attach the suggestion to an earlier hunk.
- Remapped leftover OpenCode LEFT suggested-diff comments onto a same-path current-head RIGHT hunk when one exists so those replacements become one-click GitHub suggestions instead of leftover manual-edit blocks. Pure deletions and cannot-provide fences stay leftover.
- Persisted leftover OpenCode `cannot-provide` and `LEFT` suggested-diff replacement text as a distinct overview “Manual edit (not a GitHub suggestion):” ```diff block so authors can copy the change by hand without treating it as an applyable `path:line` / `path:start-end` GitHub suggestion.
- Distinguished applyable OpenCode GitHub suggestion ranges from leftover ```diff fences (`cannot-provide` or `LEFT`) in the overview receipts so authors can see which hunks are one-click applies and which still need a manual edit.
- Listed applyable OpenCode GitHub suggestion ranges (`path:line` or `path:start-end`) in the overview receipts so authors can see which surviving hunks shipped as one-click applies.
- Set `start_line`/`line` on surviving multi-line OpenCode GitHub suggestions so a replacement that spans more than one current-head hunk line applies as one range.
- Converted surviving OpenCode inline suggested diffs into GitHub `suggestion` blocks so authors can apply the replacement on the current-head hunk in one click.
- Dropped OpenCode inline comments that sit outside every current-head changed hunk before the GitHub POST so those comments become overview receipts instead of a 422 that wipes the batch.
- Capped one-at-a-time OpenCode inline retries at 20 comments and listed attached `path:line` beside refused receipts so the overview shows both outcomes, plus any locations left untried by the cap.
- Kept each refused OpenCode inline comment's own GitHub 422 phrase next to its `path:line` so mixed retries do not collapse every failure into one shared error sentence.
- After a mixed one-at-a-time inline retry, listed only the refused `path:line` rows in the overview receipts so attached hunks are not reported as failed.
- After a batch GitHub 422, retried OpenCode inline comments one at a time so comments on surviving hunks still attach instead of dropping the entire review thread.
- Stored each refused OpenCode inline comment as a durable overview receipt that pairs the trusted `path:line` with the GitHub 422 error phrase from `gh api` stderr or JSON `errors[].message`.
- Named each trusted `path:line` in the OpenCode GitHub 422 inline-comment fallback so a refused attach still tells the author the exact current-head location instead of a generic “cited finding lines” sentence.
- Bounded the Strix quality self-test's deterministic timeout fixtures to 3-second process and 5-second fake-sleep budgets so exact-head policy evidence completes inside the existing job limit without changing production Strix scanner timeouts, providers, credentials, or review semantics.
- Allowed commas and ASCII parentheses in the bounded Strix changed-file path policy so legal tracked Packrat fixtures can receive exact-head security analysis, while rejecting raw `..` components before normalization and keeping controls, backslashes, whitespace ambiguity, and shell punctuation fail-closed.
- Bound each review-agent invocation key to the wrapper's complete canonical payload, including the base branch and requesting actor; altered fields with a valid-format key now fail before durable-leader election or forwarding, and wrapper write permission is job-scoped.
Expand Down
6 changes: 5 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ disciplines CP-1..CP-5/G6/SEAM, binding engineering conventions in §7, roadmap)
[GitHub Project #1](https://github.com/orgs/ContextualWisdomLab/projects/1) (work/roadmap source of
truth), and operate the Project per [`docs/agent-github-project-protocol.md`](docs/agent-github-project-protocol.md).
The repo/Project — not private agent memory — is the source of truth. This file complements those
documents; it does not replace them.
documents; it does not replace them. Materialize accepts only exact SHA-256
pins or a bounded relative `-r` include; `base_hash_locks` discovers
hash-pinned `requirements/*.txt` via `_is_candidate_lock_path`. Bare `422`
substrings are not HTTP 422. `run_failed_check_diagnosis` must pass
`$control_json` to `build_inline_comment_failure_body`.

## What this repository is

Expand Down
Loading
Loading