Skip to content

ci(limits): inventory numeric REA_ limits and check them - #9884

Open
morluto wants to merge 5 commits into
mainfrom
cursor/rea-limit-inventory-01f4
Open

morluto wants to merge 5 commits into
mainfrom
cursor/rea-limit-inventory-01f4

Conversation

@morluto

@morluto morluto commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

Part of #9881. Every numeric REA_ limit is listed with its owner, default, floor, maximum, when it is read, and its classification. Static checks fail when a new numeric REA_ limit is neither a runtime analysis setting nor on that list with a reason.

Discovery uses the TypeScript parser (typescript6). A producer is a property access, an element access, or an argument to a call, including a same-file const string. Comments and array literals are not producers because they are not those nodes. A later helper argument such as read(environment, "REA_NEW_MAX_BYTES") stays classified.

Problem and expected behavior

Runtime analysis settings cover 17 values. Other numeric REA_ limits are still read from the launch environment, and nothing stopped a new one from landing without a classification. The inventory records 14 runtime environment seeds, 11 per-call limits that still use the launch value, and 15 restart-only numeric limits. REA_NTFS_MFT_MAX_FILE_BYTES (#9868), REA_REGF_HIVE_MAX_FILE_BYTES (#9865), and REA_WEB_BUNDLE_ENDPOINT_LITERAL_CANDIDATES (#9836) are absent from this tree and must join ANALYSIS_SETTINGS once they appear. The exception registry cannot classify them.

Change and scope

The narrative inventory is docs/design/rea-limit-inventory.md. src/domain/numericLimitRegistry.ts is the machine-readable exception list. scripts/verify/rea-numeric-limits.mjs scans src (tests excluded) and runs from npm run lint.

policy: "per-call" is temporary. Those 11 limits are checked when the work runs and still copy the launch value. Durable exceptions use policy: "restart-only".

Follow the contribution scope. Ordinary classification of existing limits; no new provider, target execution, injection, mutation, or protection recovery. Maintainer scope decision: not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: the numeric-limit registry owns the exception list. Discovery owns which syntax counts as a read. No provider behavior changes.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): none.
  • Generated metadata: the documentation nav lists the inventory. No package or catalog change.

Expected effects:

  • Documentation or usability only; no target interaction.

Evidence and regression coverage

  • Tests added or updated: tests/evaluation/numericLimitCheck.test.ts covers property access, registry text, a later helper argument, a bound argument, bracket access, allowlists, comments, and prose that merely mentions a name.
  • Base reproduction or other evidence: node scripts/verify/rea-numeric-limits.mjs reports 14 runtime, 15 restart-only, 11 per-call, 40 discovered.
  • User-visible CLI/MCP output: none.
  • Remaining proof gaps: non-numeric settings are documented but not enforced by the numeric check.

Validation performed

  • npm run check:fast — passed.
  • npm run test:focused -- tests/evaluation/numericLimitCheck.test.ts — passed (7 tests).
  • node scripts/verify/rea-numeric-limits.mjs — passed: 14 runtime, 15 restart-only, 11 per-call pending migration, 40 discovered.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. The check fails only for a numeric REA_ limit that is unclassified.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.

Author readiness

Human owner: @morluto

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.
Open in Web Open in Cursor 

Part of #9881. Record every numeric REA_ limit and fail static checks when one is neither a runtime analysis setting nor a documented exception with a reason.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T23:22:39.774108Z e603982 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 11839a2ef8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/verify/rea-numeric-limits.mjs Resolved
Comment thread scripts/verify/rea-numeric-limits.mjs Resolved
@morluto
morluto added this pull request to stack #9886 November 10, 2026 22:17
…tions

The numeric-limit check now treats REA_WEB_BUNDLE_ENDPOINT_LITERAL_CANDIDATES as a count limit and does not count registry text as a producer.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 972d652483

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/verify/rea-numeric-limits.mjs Resolved
Comment thread scripts/verify/rea-numeric-limits.mjs Resolved
Discovery no longer treats comments or registration-list entries as producers. The three limits moving on their own PRs must join ANALYSIS_SETTINGS; the exception registry cannot classify them.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 42f42c1ffc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/verify/rea-numeric-limits.mjs Resolved
A quoted name after an identifier, call, or optional chain is a producer. Only declaration arrays and comments stay out of discovery.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a7fbfdd21

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/verify/rea-numeric-limits.mjs Resolved
Property access, element access, and helper-call arguments are producers. Comments and array literals are excluded by the tree, so a later argument such as read(environment, "REA_NEW_MAX_BYTES") stays classified.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e603982ddd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +178 to +182
if (ts.isVariableDeclaration(node) && node.initializer !== undefined)
remember(
discovered,
relativePath,
literalText(unwrapExpression(node.initializer)),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Inspect destructured environment keys

When a new limit is read through destructuring, such as const { REA_NEW_MAX_BYTES } = environment, the limit name is stored in the variable declaration's binding pattern rather than its initializer. This branch inspects only the initializer, and the visitor has no handling for binding elements, so discoverNumericLimitUses returns no entry and the verifier permits the limit without either an analysis setting or registry classification. Handle destructured property names as producer reads as well.

AGENTS.md reference: AGENTS.md:L27-L27

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants