ProcessManager: shared process factory and one ROW_COLORS_JSON emitter
#84
Closed
opened 2026-09-10 18:23:14 +01:00 by gronod
·
1 comment
No Branch/Tag Specified
main
docs/27-roadmap-candidates
develop
milestone/m13-print-ticket
feat/218-paper-source
feat/217-panel-ticket-restore
bugfix/211-print-output-flip
milestone/m12-native-spool
feat/202-airprint-detection
feat/201-native-print-operation
feat/201-raster-canvas
feat/201-ticket-capture
feat/201-pm-ticket-bridge
chore/m11-sync-develop
milestone/m11-print-settings
chore/m11-docs-hygiene
feat/186-panel-binding
feat/181-canon-media-locale
feat/180-epson-qual-options
feat/183-stage2-print-settings
chore/m11-tracking
docs/ui-interactive-map
v2.0.4-prerelease-docs27
v2.0.4
v2.0.3
v2.0.3-prerelease
v2.0.2
v2.0.1
v2.0.0
Labels
Clear labels
Bug/Architecture
Bug/Backend
Bug/DevOps
Bug/UI
Compat/Breaking
Feature/Architecture
Feature/Backend
Feature/DevOps
Feature/UI
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Project/ICCery-v2
Core / wizard / process infra defect
Argyll orchestration, file/data defect
Build, packaging, CI defect
Views, controls, dialogs defect
Breaking change that won't be backward compatible
Core / wizard / process infra
Argyll orchestration, file/data engines
Build, packaging, CI
Views, controls, dialogs
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Low
4
The priority is low
Priority
Medium
3
The priority is medium
ICCery v2 Mac rewrite
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Milestone
No items
No Milestone
M7 — Deduplicate & consolidate (develop)
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gronod/iccery-v2-mac#84
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
ProcessManager.runStreamingandrunCapturedboth constructProcess, attach pipes, setchildEnvironment(ARGYLL_NOT_INTERACTIVE=1), log sanitized argv, and install both aterminationHandlerand aTask.detached { waitUntilExit() }watchdog (#50/#52).ROW_COLORS_JSON:prefix handling is copied iningestOutput,flushPartialLine, andmaybeFinalize.Extract internals only. Do not merge streaming and captured APIs — captured has no stdin, different EOF story, and is the printcal/applycal/CUPS path.
Spec refs
docs/03-ipc-and-process-manager.mdProcessManager.rowColorsPrefix = "ROW_COLORS_JSON: "(space after colon)Scope
In
makeProcess(binary:arguments:workingDirectory:environment:standardInput:)private helper that returns the configuredProcess+ pipes.spawnvsspawn(captured)prefix can stay).terminationHandler+ detachedwaitUntilExit).emitStdoutLine(id:line:)used by ingest / partial flush / finalize:.jsonRowwith prefix stripped and do not also emit.stdout.stdout.stderr+ warn log.Out
Boxcontinuation (leave it unless a test proves a race).q\n+ 500 ms hook.runCaptured.Full solution
childEnvironmentremains the single place that forcesARGYLL_NOT_INTERACTIVE=1.makeProcess.forceKill+forceFinalizeafter 2 s) stays streaming-only.Rewrite invariants
stdoutevents.killAllstill covers bothchildrenandcaptured.exitonce (watchdog exists becauseterminationHandlercan lose the race).Dependencies
Blocks-on: none. Can land in parallel with the runner extract; rebase if both touch spawn logging tests.
Test
Existing
Tests/ICCeryCoreTests/ProcessManagerTests.swiftmust stay the contract:Add:
ROW_COLORS_JSON: {line without newline;flushPartialLinemust emitjsonRownotstdoutjsonRowon finalizeexiteventAcceptance criteria
Implementation originally landed in stacked commit
d4261bavia PR #87.Completion/verification landed in PR #100 at
e48c3f6.Acceptance evidence:
[x] Centralised private spawn logging in ProcessManager preserving exact prefixes and LogSanitizer.
[x] Added deterministic tests for partial ROW_COLORS_JSON flush and exit tail finalisation.
[x] Verified fast-exit watchdogs emit exactly one exit event on streaming and captured paths.
[x] Verified ARGYLL_NOT_INTERACTIVE=1 in captured child environment.
[x] Mixed streaming + captured killAll verified.
Verification at milestone/m8-consolidation
891a504ee7:targeted suites: passed (27 tests)
full universal ICCeryCoreTests: 339 passed, 0 failed
full ICCeryUITests: 29 passed, 0 failed
Closing manually after code and tests are present on the milestone branch.