Repository navigation
feat(daemon,cli): daemon log records every request and background failure; daemon logs --follow - #187
Merged
Merged
Conversation
…e log live - runDispatch writes one operation line per call on every frontend, levelled by the operation's new contract effect (write: info, read: debug) - core modules log the background failures they handle, with device, step and error - LoggingProcessRunner logs each device command at debug - event subscriber failures go to daemon.log as JSON - simlock daemon logs --follow polls through the Filesystem/Clock ports and survives rotation
…one log line per failed cleanup run, untested paths covered
…s, authorize fails closed, --follow only on logs, wiring covered by tests
# Conflicts: # CHANGELOG.md # docs/CONFIGURATION.md # docs/internal/ARCHITECTURE.md # src/cli/index.ts # src/core/lease-acquisition-coordinator.ts # src/core/lease-engine.test.ts # src/daemon/main.test.ts # src/daemon/main.ts # src/daemon/server.ts # src/gateway/dispatcher.test.ts # src/ports/logger.ts
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.
Closes #169
daemon.lognow records what the daemon was asked to do and what went wrong (ADR 0006).operationline, built only inrunDispatch, for socket, MCP, HTTP and gateway dispatch. Its level comes from the new contracteffect: write at info, read at debug, failure at info,INTERNALat error.debug,LoggingProcessRunnerlogs each device command with its exit code. It never logs env, input or output.simlock daemon logs --followpolls throughFilesystem/Clock, detects rotation fromdaemon.log.1changing identity, and waits for a missing file.Deviations from the spec:
doctor --purge-orphanscounts as a write, because it destroys devices.Completion conditions
e2e/daemon-log.test.tsUNKNOWN_MODEL. e2estatusadds no line at the default level and one atdebug. e2estep: bootand the driver's error text. e2e and unitdebug, each device command leaves a line with its exit code. e2e (device.exec) and unitconsole.error.main.test.tsthroughstartDaemon--followprints a later lease's line, and keeps printing after rotation with a smalllog.rotateBytes. e2e and unit--follow.pnpm checkgreen. Each new test was seen failing with its code removed.Review
Spec review: 16 findings over two rounds, 6 fixed. Code review: 10 findings over two rounds, 9 fixed.
Rejected:
doctor.runwithpurgeOrphansis a write — it destroys devices, and the Outcome says every state change leaves a line. Spec needs:purgeOrphansin the effect list.messageonly after validation.log.rotateBytesrow added to CONFIGURATION.md — neitherlog.*key was documented, and the log paragraph names this one.checkAccess/authorizeContextsplit out ofrunDispatch— required by the pre-commit complexity gate. Behaviour unchanged.fallow-ignorecomment edits — the pre-commit audit flags them in files this diff touches.classifyErrorinserver.ts, notmain.ts—server.tsbuilds that dispatcher and already imports it. Same effect.cleanup.runthat joins a failing scheduled run gets both lines — the background run failed and the request is a separate record.Written by an agent.