Repository navigation
entrypoint: forward an opt-in report descriptor to run_json - #535
Closed
luisleo526 wants to merge 8 commits into
Closed
luisleo526 wants to merge 8 commits into
luisleo526 wants to merge 8 commits into
Conversation
The entrypoint builds the extra run_json arguments from environment variables. A caller that opens a descriptor for the report records itself has no way to pass it through the container entrypoint. These rows drive the real entrypoint with a private prefix and a logged run_json argv: - variable unset: the argv is exactly the old one, for Pine and C++ input; - variable set: the descriptor number is forwarded once as --report-sink-fd, an empty value is forwarded as an empty argument, and the position among the other forwarded options is fixed; - invalid values (0, 1, 2, a negative number, 5, a non-number) are forwarded unchanged and refused by run_json itself with its own text; the entrypoint maps the refusal to its usual exit status 4. A native row checks that the records of a run reach the caller's descriptor and that standard output carries only the small document. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
PINEFORGE_REPORT_SINK_FD=<n> makes the container entrypoint pass --report-sink-fd <n> to run_json.py, for a caller that opened the descriptor for the report records itself. The value is forwarded unchanged and run_json remains the only validator, so its refusals (a number below 3, 5, a phase descriptor, a non-number) apply as they do for the flag. With the variable unset the entrypoint behaves exactly as before. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ries Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
luisleo526
marked this pull request as ready for review
October 26, 2026 19:09
luisleo526
added a commit
that referenced
this pull request
Oct 26, 2026
…iagnostics, dependency-scratch storage fault code (#536) ## What One change set that carries four reviewed pull requests together, so the release gate and the parity sweep run once on the exact tree that ships. Each of the four was reviewed and green on its own; this branch is the first, #536, plus merges of the other three. No line was rewritten. - #533 Report a storage fault on the dependency scratch as scratch_io_failed - #534 run_json: report the recorded failure when the internal report sink is refused - #535 entrypoint: forward an opt-in report descriptor to run_json - #536 run_json: report the run profile and jailed arena admission in the diagnostics ### Dependency scratch fault (from #533) A read, write or resize fault on the scratch that holds waiting requests now ends the run as `scratch_io_failed`, a non-retryable `resource` failure, instead of `engine_invariant`, as the exit-scratch consumer already did for the same storage status. A failure the storage layer had already recorded keeps its own code. The run-failure catalog is unchanged. The change is in `require_dependency_scratch` (`src/native_execution_consumer.cpp`) and adds no net lines, so the file keeps its line count and the documentation line anchors stay valid. ### Typed failure for a refused internal report sink (from #534) On the default route `run_json.py` installs an internal report sink. When the engine refused it, for example because the scratch arena descriptor, size or profile flag in the environment was unusable, the host reported `engine_invariant` and dropped the failure the engine had recorded. It now reads that record before the strategy state is freed and reports it (`report_sink_failed` with reason `arena_backing` for an unusable arena). If the engine recorded nothing, the previous message and code are kept. No success path changes. ### Opt-in report descriptor in the container entrypoint (from #535) `PINEFORGE_REPORT_SINK_FD=<n>` makes the entrypoint pass `--report-sink-fd <n>` to `run_json.py`, for a caller that opened the descriptor for the report records itself. The value is forwarded unchanged, an empty value as an empty argument, and `run_json.py` stays the only validator (a number below 3, 5, a phase descriptor and a non-number are refused with its usual text and exit 2, mapped to 4 by the entrypoint). With the variable unset nothing changes. ### Run profile in the report diagnostics (from #536) Every executed success report carries two additive `diagnostics` keys: `run_profile` (`"jailed"` or `"unjailed"`, fixed when the run starts) and `scratch_arena_jailed` (true only when the jailed profile ran and the native scratch arena admission succeeded). The flag comes from the actual admission result, never from the environment. It records the checked profile and the admission; it is not an independent check of operating-system confinement. Failure, capability and validate-only documents, and every existing key and its order, are unchanged. The replay converter keeps both keys. Python only: no native export, no C++ change. ## Tests Each change keeps the tests it was reviewed with, committed before the fix so each fails on the unchanged tree for the stated reason: the dependency-scratch fault rows (`engine_invariant` observed), the unjailed sink refusal rows (twelve real-module rows and a free-order double), the entrypoint forwarding rows (the logged argument vector lacks the option), and the profile rows (both keys absent). The faults in the first group are injected through a backing double; no claim is made that a real disk `EFBIG` reaches that helper. ## Compatibility - A host that matched `engine_invariant` for a dependency-scratch storage fault now sees `scratch_io_failed` (class `resource`, not retryable). - A host that matched `engine_invariant` for a refused internal report sink on the default route now sees `report_sink_failed` / `arena_backing` for the cases above. - Two additive keys in the success report `diagnostics` object; one opt-in environment variable. The 1.8.0 changelog describes all four. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Collaborator
Author
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.
What
The container entrypoint builds the extra
run_json.pyarguments from environment variables. A caller that opens a descriptor for the report records itself had no way to pass it through the entrypoint.PINEFORGE_REPORT_SINK_FD=<n>now makes the entrypoint pass--report-sink-fd <n>.The value is forwarded unchanged (an empty value is forwarded as an empty argument), and
run_json.pystays the only validator: it refuses a number below 3, 5, a descriptor equal to a phase descriptor, and a non-number, with its usual text and exit 2, which the entrypoint maps to its usual exit 4. With the variable unset the entrypoint behaves exactly as before. The change is one line indocker/entrypoint.sh, plus a README row; one citation indocs/design/BARS-BIN-INPUT.mdis re-pinned to the shifted line.Tests
tests/test_compile_inventory_pipeline.pydrives the real entrypoint with a private prefix and a loggedrun_json.pyargv: variable unset gives exactly the old argv for Pine and C++ input; set values (7,+7,007, a padded value) are forwarded once at a fixed position among the other options; an empty value is forwarded as an empty argument;0,1,2, a negative number, an overflowing number,5and a non-number are forwarded and refused byrun_json.pywith its own text, exit 2 mapped to 4; the selected-window and provenance options keep their order.tests/test_run_json_sink_fd.pygains a native row that runsrun_json.pyitself with--report-sink-fd(the flag the entrypoint forwards to) and checks that the records reach the caller's descriptor and that standard output carries only the small document. The entrypoint tests use a stubrun_json.pythat logs its argv, so no test runs the entrypoint and the real harness together; the two halves are covered separately.On the tests-only commit 13 rows fail because the logged argv has no
--report-sink-fd; the unset rows pass. With the change all pass.Compatibility
Additive and opt-in. Nothing changes unless the variable is set.
🤖 Generated with Claude Code