Skip to content

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

Merged
gensokyo-dev merged 26 commits into
mainfrom
cursor/rea-limit-inventory-01f4
Nov 11, 2026
Merged

gensokyo-dev merged 26 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) to identify numeric limit candidates and direct, unshadowed process.env reads. Candidate syntax and unresolved dynamic keys are reported as uncertain; syntax does not prove reachability, invocation frequency, or complete coverage. External Python reads and the generated bridge control have separately identified behavioral witnesses. The pre-install guard defers parsing until typescript6 is installed; npm run lint runs it after npm ci.

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.

Evidence and regression coverage

The scanner tests cover direct and candidate evidence, dynamic and shadowed aliases, AST-owned runtime setting seeds, numeric expression contexts, write-only accesses, provenance declarations, and syntactic lifecycle observations. The Python display-helper and reconnect tests exercise their respective consumer behavior; the bootstrap test separately checks generation of the reconnect control. Python-dependent tests can skip when Python is unavailable, and Node lint only checks that the declared witness files exist.

Validation performed

  • npm run check:fast — passed on the current integrated change.
  • npm run test:local -- tests/evaluation/numericLimitCheck.test.ts src/domain/numericLimitRegistry.test.ts src/hopper/bridgeBootstrapLimit.test.ts — 23 passed before the latest AST fix; the updated scanner suite passed all 21 tests.
  • npm run test:focused -- tests/boundary/providers/hopper/linuxPrivateDisplay.test.ts tests/boundary/providers/hopper/hopperBridgeReconnect.test.ts — 14 passed, 5 skipped on the equivalent pre-integration tree; Python timeout and reconnect cases ran.
  • Numeric-limit guard — passed; it reports candidate-only and unresolved reads as unverified.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. The check also reports unresolved discovery and can reject stale registry entries without recognized syntax or explicit external provenance.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.

Integration validation (2026-11-11)

Preserved the original contribution commits and authors while linearizing the branch for the repository's rebase-only merge policy. Follow-up commits align the full-catalog child/test deadlines, abort unfinished child execution, and distinguish the 38 recognized TypeScript candidates from two external/generated controls.

Executed on Node 24.22.1 with CPU affinity limited to two cores: check:fast, docs:check, 24 registry/discovery/bootstrap tests, the full-schema contract presentation test (1), and Hopper Python/process boundary witnesses (19), all passed. Documentation route/link verification also passed before the prose-only follow-ups. No real provider GUI was exercised. A prepared-artifact full/full fixture run took 31.73 s, 29.01 s user CPU + 1.53 s system CPU; sampled descendant-family PSS peaked at about 944 MiB (250 ms samples, excludes Vitest). These are bounded-run observations, not a speedup claim.

GitHub Actions checks remain queued; this is unverified CI, not a passing result. The existing human-owner readiness declarations below are preserved.

Post-merge history verification: the rebase merge retained 22 commits with their original authors/messages and an identical final tree. GitHub omitted four historical commits that were already tree-empty on the linearized branch; the original PR head faac54bd70c1a644f4533269ef888138e7466c29 retains the pre-merge history. No contribution changes were squashed.

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 

@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-11T11:37:29.584847Z 5951cc1 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

@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

@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

@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

@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 thread scripts/verify/rea-numeric-limits.mjs Resolved

@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: d957d00db4

ℹ️ 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 src/domain/numericLimitRegistry.test.ts Resolved
Comment thread scripts/verify/rea-numeric-limits.mjs Resolved

@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: 0e1389858e

ℹ️ 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 src/domain/numericLimitRegistry.ts Resolved

@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: 02d8fd878d

ℹ️ 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 docs/design/rea-limit-inventory.md Resolved

@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: 24218ab82b

ℹ️ 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 docs/design/rea-limit-inventory.md Resolved

@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: 297d8c7712

ℹ️ 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 src/domain/numericLimitRegistry.test.ts Resolved

@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: 11d4869edd

ℹ️ 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

@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: 907b81ec9e

ℹ️ 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

@morluto morluto left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

LGTM

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.
…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.
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.
A quoted name after an identifier, call, or optional chain is a producer. Only declaration arrays and comments stay out of discovery.
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.
…all guard dependency-free

Object bindings, in-checks, and object keys that a spread can copy are producers. The architecture guard skips the TypeScript parse until typescript6 is installed, and the inventory links stay inside the published site.
A one-test suite named for the bridge script was collected with no tests in the full source run, which failed the file. The same assertion now sits directly on the file.
The main merge dropped the fs import that the file-level assertion uses.
A loaded shard killed the full-catalog child at its 20s limit.
cursoragent and others added 9 commits November 11, 2026 11:07
oxfmt rejects the tables that arrived with main.
The main merge left two tables that oxfmt rejects.
A constructor copy is not a per-call read. Numeric limits also come from a number schema or a numeric parse, and the inventory no longer lists path and provider constants.
New per-call registry entries are rejected. Inventory checks require a table row, and the Electron argv handoff is process protocol rather than a caller setting.
A numeric parser now reads property and element accesses in its argument, so Number(process.env.REA_ARCHIVE_ENTRY_LIMIT) is a producer without a schema key. Template discovery keeps generated assignments and no longer treats a diagnostic sentence as a read.
@gensokyo-dev
gensokyo-dev force-pushed the cursor/rea-limit-inventory-01f4 branch from aba4525 to 46cd474 Compare November 11, 2026 11:10

@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: 46cd474c5d

ℹ️ 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
@N0zoM1z0

Copy link
Copy Markdown
Collaborator

Integration note: the full/full presentation fixture completed in 31.73 s on two CPU cores with prepared artifacts (29.01 s user + 1.53 s system CPU; sampled family PSS about 944 MiB). The enclosing test passed in 32.19 s with a 60 s child deadline and 70 s outer deadline. Commit 5951cc1 restores a 20 s child deadline, which is below this measured successful runtime, so I am retaining the 60/70 s budgets and cancellation hook in a separate follow-up. The 16 MiB output bound and all schema/handler assertions remain intact.

@gensokyo-dev
gensokyo-dev merged commit cc6c52b into main Nov 11, 2026
5 of 7 checks passed
@gensokyo-dev
gensokyo-dev deleted the cursor/rea-limit-inventory-01f4 branch November 11, 2026 11:39
@morluto morluto added the area: build Build, CI, packaging, and publishing label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants