Skip to content

refactor(worker): share the platform browser opener; add the graph artifact dir (issue #54) - #169

Merged
edgehero merged 1 commit into
mainfrom
feat/open-browser-and-graph-dir
Aug 11, 2026
Merged

refactor(worker): share the platform browser opener; add the graph artifact dir (issue #54)#169
edgehero merged 1 commit into
mainfrom
feat/open-browser-and-graph-dir

Conversation

@edgehero

Copy link
Copy Markdown
Owner

Fifth slice of issue #54: two enablers for the graph HTML export, behaviour-identical for everything that exists today. Independent of #168 (both branch from main after #167).

What

  • The best-effort platform browser opener moves from github-app-setup.mjs into worker/src/open-browser.mjs with an exports-map subpath (./open-browser): the graph export needs the same spawn, and two hand-copies of platform-opener argv is exactly the drift class the repo's mirror tests exist to prevent. The argv table, the detached/ignored/unref posture and the swallow-everything doctrine are unchanged and now pinned literally per platform (the up.mjs exact-argv doctrine); spawn and platform are injectable so nothing launches in tests. The wizard's injected openBrowser seam is untouched, so its test harness needed no change.
  • defaultGraphDir joins defaultLogsDir/defaultSandboxDir in config.mjs: the worker-owned temp path for the graph artifact (${TMPDIR}/pi-dispatch/graph), PI_GRAPH_DIR override, and deliberately not inside logsDir, whose filename shape is contract (INT-RUN-HISTORY-FILE-CONTRACT) — a stray .html beside the sidecars would widen a contract for a file that is not a record.
  • resolvePaths mirrors it as graphDir on the existing pattern; the workspace-exports probe fixture covers the new subpath.

Specs

No entry changes on purpose: this refactor changes no behaviour, and the artifact itself (with its DES-ADMIN-VIA-PI-EXTENSION amendment and new REQ) is the next slice. INT-RUN-HISTORY-FILE-CONTRACT UNCHANGED, checked (nothing new is written into logsDir). DES-GH-APP-MANIFEST-SETUP UNCHANGED, checked (same opener, same doctrine, one module over).

Tests

Per-platform exact-argv pins, the swallowed sync-failure and inert error-handler cases, unref/error-listener assertions; defaultGraphDir fallback chain and backslash normalisation; resolvePaths.graphDir override/default/empty. Suite in the CI posture: 2108 pass, 0 skipped; admin bundle builds.

…tifact dir (issue #54)

Two enablers for the graph HTML export, behaviour-identical for
everything that exists today.

The best-effort platform opener moves from github-app-setup.mjs into
its own module with an exports-map subpath (./open-browser), because
the graph export needs the same spawn and two hand-copies of
platform-opener argv is exactly the drift class the mirror tests exist
to prevent. The argv table, the detached/ignored/unref posture and the
swallow-everything doctrine are unchanged and now pinned literally per
platform (the up.mjs exact-argv doctrine); spawn and platform are
injectable so nothing launches in tests. github-app-setup's injected
openBrowser seam is untouched.

defaultGraphDir joins defaultLogsDir/defaultSandboxDir in config.mjs:
the worker-owned temp path for the graph artifact, PI_GRAPH_DIR
override, and deliberately NOT inside logsDir, whose filename shape is
contract (INT-RUN-HISTORY-FILE-CONTRACT). resolvePaths mirrors it as
graphDir on the existing pattern.

Specs: no entry changes; the artifact itself (and its
DES-ADMIN-VIA-PI-EXTENSION amendment) is the next slice, and this
refactor changes no behaviour. INT-RUN-HISTORY-FILE-CONTRACT
UNCHANGED, checked (nothing new is written into logsDir).
DES-GH-APP-MANIFEST-SETUP UNCHANGED, checked (same opener, same
doctrine, one module over).

Suite in the CI posture: 2108 pass, 0 skipped; admin bundle builds.

Signed-off-by: Rob Boerman <robboerman@live.nl>
@edgehero
edgehero merged commit f47b535 into main Aug 11, 2026
12 checks passed
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.

1 participant