Close exec() once, so remote delivery stops raising SyntaxError - #395
Merged
Merged
Conversation
`f6b8af41` (the Windows daemon port) rewrote the installer's embedded
python to an `exec('def w(p,c): …')` helper and closed the call twice:
the emitted program ends `exec('…')');`. Python raises SyntaxError on
the stray `')` before writing a byte.
The fragment ends in `>/dev/null 2>&1 || true`, so nothing saw it. Every
remote delivery since 2026-09-15 has been a silent no-op: no CLI shim at
~/.graphcode/bin/graphcode, no briefing, no wake digest, no PROMPT.md —
on every remote host and Codespace, for the whole of 0.1.73. A loop
there could not reach the graph, and one whose goal had been shed to a
file booted pointing at instructions that were never delivered.
Every existing test asserts on the script as *text* — that it mentions
python3, that its manifest decodes, that it is `|| true`d — and none of
that notices a program python will not parse. The new suite runs the
real fragment under /bin/sh against a scratch HOME and checks what
landed, including that the delivered shim itself compiles.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: scgopi <scgopireddy@gmail.com>
scgopi
added a commit
that referenced
this pull request
Sep 20, 2026
Delivery ended '>/dev/null 2>&1 || true'. The '|| true' is right - a launch must never be blocked because a briefing did not land - but the '>/dev/null 2>&1' is a different decision wearing the same clothes, and it is why #395's SyntaxError survived five days and reached a stable release: the reason went to /dev/null on every dial, on every remote host, every 60 seconds. Failure stays non-fatal and now reaches the host's own dial log as 'delivery install failed <reason>', flattened to one line, UTF-8 safe, and sized from DialLog's own trim budget rather than a chosen number. Reviewed adversarially by a sibling loop, which found five defects across two rounds - a UTF-8 split that would have made every other dial entry on the host unfindable, a line length that broke DialLog's trim bound permanently, a trim race this change would have made routine, a dropped exit code, and a test assertion of mine that accepted what the line it replaced forbade. All five fixed and re-verified by running, including that an over-cap log now recovers.
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.
The bug
Every remote delivery has been a silent no-op since 2026-09-15. On remote hosts and Codespaces there is no
~/.graphcode/bin/graphcode, no briefing, no wake digest and noPROMPT.md— for the whole of0.1.73.f6b8af41(the Windows daemon port) rewrote the installer's embedded python into anexec('def w(p,c): …')helper and closed the call twice. The emitted program ends:Python raises
SyntaxErrorbefore writing a byte. The fragment ends in>/dev/null 2>&1 || true, so nothing on the Mac ever saw it.This is the real cause of both symptoms reported today: a Codespace with no CLI shim, and a loop whose entire brief was a pointer at a
PROMPT.mdthat was never delivered.Measured
Reconstructing the exact emitted program from the Swift source and running it:
f6b8af41^(before the Windows port)exit 0, file writtenorigin/maintodayexit 1,SyntaxError, nothing writtenexit 0, shim written mode0755, briefing written, receipt writtenWhy no test caught it
Every existing test asserts on the script as text: that it mentions
python3, that its base64 manifest decodes, that it is|| trued. None of that notices a program python refuses to parse.RemoteInstallerExecutionTestsruns the real fragment under/bin/shagainst a scratchHOMEand asserts on what landed — contents, the shim's executable bit, the receipt — pluspy_compileon the delivered shim, and both halves of the neutered/un-neutered exit-status contract. Skipped, never silently passed, ifpython3is absent.Verification
xcodebuild -scheme graphcode testexit=0,** TEST SUCCEEDED **,Test run with 1903 tests in 200 suites passedxcodebuild -scheme graphcode-cli buildexit=0xcodebuild -scheme graphcoded buildexit=0swiftlint lintswift format lint --recursive --strictexit=0TDD evidence
RED: restore the stray quote and run xcodebuild -only-testing:graphcodeTests/RemoteInstallerExecutionTests -> exit=65, theInstallerActuallyWritesEveryFileItCarries fails 5 expectations and aDeliveredShimIsAProgramPythonCanRun fails 2
GREEN: xcodebuild -scheme graphcode -destination platform=macOS test -> exit=0, ** TEST SUCCEEDED **, Test run with 1903 tests in 200 suites passed
REGRESSION: full suite plus graphcode-cli and graphcoded builds, swiftlint and swift format lint -> exit=0 on every step, 0 lint errors, the 1900 pre-existing tests all still pass