fix(markers): bound declarations per scan - #181
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Mark Beacom <m@beacom.dev>
Decisions governing this change
Historical records that once covered this changeThese no longer bind this change, and are listed for context only:
|
There was a problem hiding this comment.
🟢 Approval recommended
The implementation consistently enforces deterministic bounds, preserves exit-code semantics, and includes comprehensive cross-surface coverage.
Pull request overview
Bounds inbound @adr declaration amplification while preserving deterministic ordering, exact reporting, and advisory-only behavior.
Changes:
- Adds 64-per-file and 10,000-per-batch declaration limits.
- Reports overflow through core, CLI, Action, and JSON surfaces.
- Adds boundary, ordering, memory-bounding, and rendering coverage plus documentation.
File summaries
| File | Description |
|---|---|
site/src/content/docs/commands.mdx |
Documents declaration limits and output fields. |
site/src/content/docs/ci.mdx |
Documents Action overflow reporting. |
README.md |
Summarizes marker safety limits. |
packages/core/test/surface.test.ts |
Verifies public constant exports. |
packages/core/test/markers-scan.test.ts |
Tests file and batch caps. |
packages/core/test/markers-pool.test.ts |
Tests concurrent result ordering. |
packages/core/test/check.test.ts |
Tests collapsed advisory findings. |
packages/core/src/markers/scan.ts |
Enforces the per-file cap. |
packages/core/src/markers/read.ts |
Enforces deterministic batch limits and accounting. |
packages/core/src/markers/index.ts |
Exports new marker APIs. |
packages/core/src/check/index.ts |
Adds declaration reports and warnings. |
packages/core/README.md |
Documents core contracts. |
packages/cli/test/explain.test.ts |
Updates explain JSON expectations. |
packages/cli/test/explain-markers.test.ts |
Tests explain overflow reporting. |
packages/cli/test/check.test.ts |
Tests check output and exit behavior. |
packages/cli/src/index.ts |
Renders declaration counts and notices. |
packages/cli/README.md |
Documents CLI limits and reporting. |
packages/ci/test/comment-render.test.ts |
Tests bounded Action comments. |
packages/ci/test/bundle-scope.test.ts |
Verifies bundle scope. |
packages/ci/test/action.test.ts |
Tests Action overflow behavior. |
packages/ci/src/comment.ts |
Adds overflow details to scan health. |
packages/ci/src/action.ts |
Logs declaration accounting. |
packages/ci/dist/index.js |
Rebuilds the distributed Action bundle. |
docs/adr/0022-scan-inbound-markers-in-check-and-ci-without-giving-them-exit-code-authority.md |
Records the cap policy. |
CHANGELOG.md |
Records marker and prior unreleased changes. |
AGENTS.md |
Captures the marker-cap invariant. |
Review details
- Files reviewed: 25/26 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
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.
Summary
marker-declarations-cappedfinding with no exit-code authorityexplain,check --json, CLI human output, and the Action log/comment without displacing changed-record errorsUnreleasedOutput contract
MARKER_DECLARATION_FILE_CAP = 64MARKER_DECLARATION_BATCH_CAP = 10_000omittedMarkers;explain --jsonreportsdeclarationLimit,totalDeclarations, andomittedDeclarationsmarkerScan.declarationswith total, retained, omitted, per-file omitted, batch omitted, and both limitsEvidence
packages/ci/dist/index.jsrebuilt twice byte-identically with Linuxoven/bun:1.3.14; queue bundle unchangedCloses #113