Harden review infrastructure with contextual APIs - #375
Merged
Conversation
PR #375: Harden review infrastructure with contextual APIs41 files, +3275 / -2451 Scope🔴 PR has 5726 lines changed. Split into focused PRs. 🟡 5726 lines changed. PRs under 400 receive more thorough review. 🟡 41 files changed. Are all changes related? 🟡 Changes span 13 directories. 🟡 PR mixes config and source changes. Structural✅ No structural bloat detected. Slop✅ Slop indicators look low. Static AnalysisOxlint: 1 diagnostic across 1 file (1 rule) no-array-sort (1): packages/code-review-agent/src/doctor.ts CorrectnessNo extraneous code patterns detected. |
taras
marked this pull request as ready for review
August 7, 2026 18:23
taras
force-pushed
the
agent/review-infrastructure
branch
from
August 7, 2026 20:00
876aa86 to
a940bdb
Compare
taras
force-pushed
the
agent/review-infrastructure
branch
7 times, most recently
from
August 8, 2026 10:40
81b4cfa to
f09d7cb
Compare
10 tasks
taras
force-pushed
the
agent/review-infrastructure
branch
from
August 8, 2026 21:10
2a1ce58 to
bfe133f
Compare
taras
force-pushed
the
agent/review-infrastructure
branch
from
August 9, 2026 01:04
33b26a1 to
1af2808
Compare
taras
enabled auto-merge (squash)
August 9, 2026 01:19
4 tasks
taras
added a commit
that referenced
this pull request
Aug 9, 2026
* 🔧 Share one Oxlint policy between the gate and the sensor The repository lint gate and the review sensor each carried a full copy of the Oxlint catalog, and the copies had drifted: the sensor turned pedantic and style on, so it reported 96 diagnostics over PR #375's files, nearly all generic style noise. The two also ran different Oxlint versions, so the profiles could not be compared at all. oxlint.shared.json becomes the one built-in policy. Both profiles extend it through a native JSON extends path, so a profile can no longer enable a rule the shared policy disables. The gate adds only its local JavaScript plugin and blocking rules; the sensor adds nothing. Oxlint and tsgolint are pinned to the exact versions the production review sensor already provisions, so a routine lock refresh cannot expand the rule set without changing the sensor. SENSOR_RULES in categories.ts becomes the one TypeScript catalog, and Doctor derives its available and missing rules from it. scripts/tests/oxlint-policy.test.ts proves inheritance, catalog ownership, the sensor-subset relation, override survival, and version agreement under Deno, Node and Bun. Closes #395 * 🐛 State the sensor-subset invariant as tests, not inheritance The specifications claimed extends made a profile-level override impossible. Oxlint merges first to last and the later configuration wins, so a profile that redeclared an inherited rule would override it. The real invariant is that the committed sensor profile declares no built-in rule of its own and that its active built-in set stays a subset of the gate's, with OP2 and OP5 failing verification when either stops holding. runOxlint gave stdout and stderr one shared TextDecoder, so a multi-byte character split across chunks on one pipe could take its continuation bytes from the other, and a character left pending at exit was dropped. Each pipe now has its own decoder, and both are flushed after the process settles. The conformance suite takes its directory and file operations from @effectionx/fs, keeping node:fs only for mkdtempSync, which that package does not provide. --------- Co-authored-by: Taras Mankovski <74687+taras@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
PR Review and Repo Analysis execute Markdown from the checked-out revision.
#305 is now present on
main; this prerequisite keeps its own review documentscompatible with that contract through mechanical
props.*spelling changes.It does not implement or modify the props language behavior.
What changes
./dist/xmdinside top-level<Output>regions.GitHubAuth.mdprovides lexically scoped exact-host GitHub authentication.ReviewContext,RepositoryInventory,Doctor, andOxlintDiagnosticsare typed function components with explicit schemas and contextual APIs.
review state construction use small typed helpers while Markdown remains the
composition and prompt layer.
boundary fails on malformed or unexpected Oxlint output; published tolerant
parseDoctorResultandparseDiagnosticsbehavior remains unchanged.user.type, and malformed comments payloads failthe review instead of becoming empty history.
use the current
props.*binding contract; this is a document migration only.Diagnostic disposition
The latest review diagnostic report was treated as an engineering signal, not
as a reason to dismiss the review. The new and materially rewritten code now
has decomposed component boundaries, explicit
unknownJSON narrowing,preserved parsing causes, immutable sorting, and corrected nullable/error paths.
The review-only Oxlint configuration excludes conventions incompatible with
this repository's architecture: component filename casing, required named
component exports, export ordering, generator/function style and yield rules,
mechanical import/key ordering and magic-number rules, and readonly parameter
types for contextual component boundaries. The normal repository lint
configuration is unchanged and remains authoritative for those rules. Pure
comment parsing and formatting now lives in a verified code-review-agent
module, leaving
CommentReviewData.tsas a thin I/O and orchestrationboundary.
Review guide
Start with:
.reviews/ReviewPR.md,.reviews/components/GitHubAuth.md,.reviews/components/Doctor.ts, andscripts/tests/review-infrastructure.test.ts.Then review:
Doctor.ts,OxlintDiagnostics.ts,ReviewContext.ts, andRepositoryInventory.tsfor typed contextual boundaries.CommentReviewData.ts,CommentReviewState.ts, and the tolerant parsercontracts in
packages/code-review-agent..github/workflows/review.ymlandrepo-analysis.ymlfor checked-outexecution and always-uploaded journals.
Look carefully at: exact-host matching, request/body/header preservation,
credential scope, malformed payload failure behavior, and the absence of
journal/result postflight parsing.
What must stay true
<Output>failxmd run; ordinary review findings do not.persisted as a document binding.
scope exit, and absent from durable journal output.
compatible.
implementation change, core change, or runtime change is included.
How to verify it
deno task lint— pass with 0 errors.deno task check— pass, including every.reviews/components/*.tsfile.pnpm exec tsc --project tsconfig.node.json --noEmit— pass; the ES2022Node target no longer depends on
Array#toSorted().and 0 failed; the focused review-infrastructure suite passes 10/10 under
Deno after the final document migration.
deno task check:jsr— pass,Success Dry run complete.portable runs are limited by this environment's loopback socket permission.
The push-triggered GitHub Node/Bun checks are the authoritative full suites.
git diff --check— pass.Scope
Included
<Output>failure behavior.@effectionx/fetch.tests, and surgical code-review-agent/Oxlint specification updates.
props.*migrations in the PR-authored review documents requiredby Namespace Markdown props under the props binding #305's now-current language contract.
Intentionally unchanged
main.xmd workflowlifecycle code.types, diff-preview limits, function-component generator arguments, and
secret-detection defaults.
bump is required.
New dependencies
None.
Risks and limitations
EnsureOxlint.mdretains only irreducible host operations: binary download,archive extraction, checksum verification, executable-mode changes, and
cleanup.
exact pushed head.
Scope confirmation