Skip to content

feat(errors): project fixed native and producer input allowances as typed refusals - #11623

Merged
morluto merged 2 commits into
mainfrom
feat/fixed-allowance-facts
Nov 16, 2026
Merged

morluto merged 2 commits into
mainfrom
feat/fixed-allowance-facts

Conversation

@morluto

@morluto morluto commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Refs #10508 ("fixed allowances not projected", first slice). Fixed native and producer input allowances now project as details.refusal (kind: "fixed_ceiling", allowance_kind, limit, unit) instead of carrying their value only in prose.

Problem and expected behavior

fixedNativeAllowance (native command output capture allowance, PE resource metadata allowance) returned only a remediationAction sentence with the value in text, so the error had no fixedAllowance and no details.refusal. fixedProducerInputAllowance (Ghidra installation properties, artifact analysis input) did set fixedAllowance, but wrote the byte count into the allowance name ("... of 1048576 bytes (this release has no runtime override)") instead of limit/unit. Tests matched those sentences. Expected: the shared owner fixedAllowanceOptions carries the value as facts, and prose is rendered from them.

Change and scope

  • fixedNativeAllowance(allowance, kind, limit, unit) returns fixedAllowanceOptions(allowance, kind, {limit, unit}); its two callers pass the numeric constants.
  • fixedProducerInputAllowance(bytes, allowance) passes {limit: bytes, unit: "bytes"} and keeps the plain name.
  • analysisRefusalRemediation (fixed ceiling) appends "The allowance is {limit} {unit}; this release has no runtime override." when the ceiling carries both, so every ceiling with facts (9 existing sites) states its value without restating it in the name.
  • Tests: PE resource metadata and Ghidra installation-properties tests assert details.refusal instead of sentences; the NTFS test keeps the owner's sentence as a prefix (toContain); analysisRefusal.test.ts asserts the rendered value sentence.
  • Enumerated remainder (not in this PR): 6 Deno reader sites that call fixedAllowanceRemediation directly into a message (DenoStandaloneArtifactReader.ts:657, deno/DenoSectionLayout.ts:378,530, deno/DenoVirtualFs.ts:502,511,520); artifactFixedLimitFailure (src/resources/ArtifactReader.ts:449, 6 callers) whose ArtifactReaderFailure("limit") carries prose only; and about 47 fixedAllowanceOptions calls that pass no limit.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/domain/fixedAllowanceRemediation.ts (fixedAllowanceOptions) and src/domain/analysisRefusal.ts (rendering); fixedNativeAllowance in src/domain/native/nativeDeadlines.ts now delegates to the owner.
  • Contribution scope fit and linked maintainer decision: [Design] Assert structured remediation facts instead of guidance prose #10508 direction (structured facts instead of prose).
  • CLI and MCP/tool-catalog contract: Additive: these four refusals gain details.refusal; the two producer-input ones gain limit/unit in it. Remediation wording for fixed ceilings with facts gains one sentence; the allowance name for producer input allowances no longer embeds the byte count.
  • Provider, bridge, target-format, or platform compatibility: None.
  • Evidence, artifact, provenance, or reconstruction contract: None (error projection only).
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): None.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): None; docs:check (including the generated error schema) passes unchanged.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: src/native/pe/PeResourcesProvider.test.ts, tests/boundary/filesystem/ghidraInstallationProperties.test.ts, src/application/ntfs/NtfsJournalService.test.ts, src/domain/analysisRefusal.test.ts.
  • Base reproduction or other evidence: On main the PE and Ghidra refusals project no limit/unit under details.refusal (PE has no details.refusal at all), so the new assertions fail there.
  • User-visible CLI/MCP output (if applicable): e.g. details.refusal: {kind: "fixed_ceiling", operation: "inspect_pe_resources", allowance: "The PE resource metadata allowance", allowance_kind: "parser", limit: 8388608, unit: "bytes"}.
  • Remaining proof gaps: The remaining sites listed above.

For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:focused -- analysisRefusal, NtfsJournalService, kunaProvider, PeResourcesProvider, ghidraInstallationProperties, NativeCommandAnalysisError, ArtifactAnalysisResources: 111 passed after updating the NTFS assertion (it failed once on the exact-equality sentence).
  • npm run test:focused -- analysisRefusal, fixedAllowanceRemediation, nativeExports, binaryDiagnosticsMcp, WakaruReport: 47 passed.
  • npm run check:fast, npm run docs:check: passed. Pre-commit and pre-push hooks ran.
  • Review fix (918188a): the refusal test checks 128 levels instead of the sentence; npm run test:local -- src/domain/analysisRefusal.test.ts: 12 passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: None.
  • Real Hopper/Ghidra, browser, or OS coverage: None.
  • Package or release metadata impact: None.
  • Security, privacy, process, or containment review: None.

Author readiness

Human owner:

  • 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.

…yped refusals

fixedNativeAllowance wrote its allowance and value only into the remediation
sentence, and fixedProducerInputAllowance put the byte count into the
allowance name. Both now build fixedAllowanceOptions with limit and unit, so
the native command output capture, PE resource metadata, Ghidra
installation-properties and artifact analysis input refusals project
details.refusal {kind: fixed_ceiling, allowance_kind, limit, unit}. The
fixed-ceiling remediation renders the value from those facts for every
ceiling that carries them.

Refs #10508
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-16T00:21:56.589850Z
We couldn’t complete this review. Comment @codex review to try again.
2ca49bf PR opened
ℹ️ 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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The reviewed changes appear safe to merge.

Summary

Fixed native and producer input allowances now carry numeric facts under details.refusal.

  • Fixed-limit errors include numeric caps in details and recovery text.

Reviews (2) · Last reviewed commit: "test(errors): check the rendered allowan..." · Reviewed by Greptile

Comment thread src/domain/analysisRefusal.test.ts Resolved
@morluto
morluto merged commit d4a7c17 into main Nov 16, 2026
7 of 9 checks passed
@morluto
morluto deleted the feat/fixed-allowance-facts branch November 16, 2026 00:39
@morluto morluto added area: domain Domain logic, errors, and pure functions enhancement New feature or request labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: domain Domain logic, errors, and pure functions enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant