Repository navigation
Conversation
… the bound itsup imports instrukt_ai_logging.cli, which the logger stopped shipping in 0.7.0. The bound set for that was rewritten to <0.11 by the next grouped Dependabot bump, because a 0.x minor is not a semver-major and the existing ignore rule let it through. The lock moved to 0.10.2 and the container host installed it on its next self-update, after which every itsup command failed on import: boot bringup, the nightly apply, the API and the monitor start. Restore the bound, relock to 0.6.7, and tell Dependabot to ignore logger releases from 0.7 so the bound is not rewritten again. Session: t3:5128ca34-972f-4682-ada6-678a5e45024e Human-Involved: true
The logs command took both from the logger's reader side, which the logger removed in 0.7.0 when its Python package became the writer SDK only. The CLI imports the logs command at start, so that one import kept every itsup command from starting on a current logger. itsUP now carries the two helpers in lib/log_reading.py. The follower keeps the behaviour the access log needs: it follows an existing file from its end and keeps going across truncation in place (copytruncate), replacement at the same path, and a file that is not there yet. Three things differ from the code it replaces. A line is held until its newline arrives, so --grep and --since see whole records, and a file that appears after the follow started is read from its beginning instead of from its end; the logger project's current follower does both. The file is read as bytes, so truncation is judged against a true byte offset and line endings pass through unchanged, as they already do when the file is read without --follow. The third-party note that documented the removed reader primitives as something itsUP reuses goes with the imports. Session: t3:5128ca34-972f-4682-ada6-678a5e45024e Human-Involved: true
Nothing in itsUP imports the logger's removed reader side any more, so the upper bound has no reason left. The requirement becomes a floor at the 0.10 line, the lock moves to 0.10.3, and the Dependabot rule that kept updates from lifting the bound is removed so the logger follows the same update path as every other dependency. The writer API itsUP calls, configure_logging and get_logger, has the same signatures on that release. The logging design follows: the diagnostic viewer is a standalone tool that the Python package no longer installs, the handler is no longer named after a class the logger replaced, and the read path of itsup logs is stated as itsUP's own. Session: t3:5128ca34-972f-4682-ada6-678a5e45024e Human-Involved: true
itsUP uses the organisation's one logger so that every project carries the same instruction for reading its own logs, `instrukt-ai-logs <app>`. An itsUP-owned reader stands against that: it is a second place to read logs, and because the CLI imported it at start, the reader helpers it borrowed from the logger package took every itsup command down when the logger dropped its reader side. Copying those helpers into itsUP kept the second reader alive under itsUP's ownership instead of removing it. The command, its helpers, its host-gate entry and the path helpers nothing else uses are gone. The CLI spec, the logging design, the host-boundary rules and the README state where each log is read with the tool that owns it: logger-written diagnostics with instrukt-ai-logs (the logger project's standalone tool, with its install step), the supervised units in the supervisor journal, and the Traefik access log as Traefik's own file. Session: t3:thread:delegated-task:command%3Amcp%3A90097403-c516-484c-8d66-e31ba569c0c1%3Adelegate-task%3A07981b9a-bc91-45b2-a78c-d360166c6c63 Human-Involved: true
The README and the itsup domain's CLI surface still sent readers to `instrukt-ai-logs itsup --include monitor`. The monitor has logged to its supervised unit's stdout since it became a supervised daemon and writes no file in the logger's directory, so that instruction shows none of its current records. They now name the journal, where the records are. Session: t3:thread:delegated-task:command%3Amcp%3A90097403-c516-484c-8d66-e31ba569c0c1%3Adelegate-task%3A07981b9a-bc91-45b2-a78c-d360166c6c63 Human-Involved: true
The Test workflow formats and lints `api` and `lib` and never starts `itsup`, so a dependency update that stops the CLI from importing merges green and fails first on the host, where boot bringup, the nightly apply and the daemon starts all go through that CLI. `make smoke` starts it from the synced environment and the workflow runs it after lint, so an import that no longer resolves fails the check before merge. Session: t3:thread:delegated-task:command%3Amcp%3A90097403-c516-484c-8d66-e31ba569c0c1%3Adelegate-task%3A07981b9a-bc91-45b2-a78c-d360166c6c63 Human-Involved: true
The recipe carried a guard for a missing environment: a conditional with its own error handling inside the Makefile, where no linter or reviewer of scripts sees it. The recipe now only names the CLI. A missing environment or an import that no longer resolves both end the recipe non-zero, so the Test workflow still fails before merge. Session: t3:thread:delegated-task:command%3Amcp%3A90097403-c516-484c-8d66-e31ba569c0c1%3Adelegate-task%3A07981b9a-bc91-45b2-a78c-d360166c6c63 Human-Involved: true
The design said the default source is avoided because independent processes must not share one log file. The CLI and the two CLI-family one-shots do share the default file, and the logger writes each line whole so that they can. The sentence now states what the code does: a producer with its own trigger declares a source, the CLI family shares the default. Session: t3:thread:delegated-task:command%3Amcp%3A90097403-c516-484c-8d66-e31ba569c0c1%3Adelegate-task%3A07981b9a-bc91-45b2-a78c-d360166c6c63 Human-Involved: true
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.
Why
One logger, one instruction: itsUP uses the organisation's logger (
instruktai-python-logger) so that every project reads its own logs the same way, withinstrukt-ai-logs <app>. itsUP owns no reader.itsup logs <target>went against that. It was an itsUP-owned log reader that borrowed reader helpers from the logger package. The logger dropped its reader side on purpose in 0.7.0 (the Python package is the writer SDK only; the reader is the Rust toolinstrukt-ai-logs), and becauseitsup/cli.pyimportedcommands.logsat import time, everyitsupcommand failed to start on the new logger. Boot bringup, the nightly apply and the daemon starts all go through that CLI.An earlier head of this branch answered that by copying the helpers into itsUP. That kept a second reader alive under itsUP's ownership. This head removes the reader instead.
Net change against
mainRemoved
commands/logs.py, its registration initsup/cli.pyand its entry in the host-only set.lib/paths.py:logs_dir()andaccess_log_file(), which nothing else used.docs/third-party/instrukt-ai-logging/log-reading-primitives.md, the note about the reader primitives the logger no longer ships.lib/log_reading.pywas added and removed again within this branch, so it does not appear in the net diff.Dependency
instruktai-python-logger>=0.10with no upper bound (was>=0.6.6,<0.11); the lock moves from 0.10.2 to 0.10.3, the latest release..github/dependabot.ymlhas no net change.configure_loggingandget_logger.Documentation: where each log is read
instrukt-ai-logs itsup. The docs now say it is the logger project's standalone tool, thatmake installdoes not provide it, and how to install it (README carries the command; the design snippet points at the logger project).journalctl -u <unit>.docs/project/spec/cli.mdloses thelogssection; the host-only lists in the CLI spec, the repository conventions (and the generatedAGENTS.md), and the itsup domain's host-boundary policy loselogs.docs/project/design/logging.mddrops the router as a consumer and the two router-only passages (the--grep/--sinceselection rule and the timestamp failure mode).instrukt-ai-logs itsup --include monitor. The monitor has logged to the journal since it became a supervised daemon, so they now name the journal.No feature spec or use case was bound to
itsup logs, so nothing was retired there.CI guard
make smokestarts the CLI from the installed environment (one delegation line,.venv/bin/itsup --help), and the Test workflow runs it after lint. Until now CI only formatted and lintedapiandlib, so a dependency update that stops the CLI from importing merged green.Verified
Off the container host, on macOS, in this branch's environment:
uv sync --frozensucceeds;uv lock --upgrade-package instruktai-python-logger --dry-runreports no change, so the lock holds the latest release..venv/bin/itsup --helpstarts and lists nologscommand.instrukt_ai_loggingimport cleanly on 0.10.3.bin/format.shthenbin/lint.shpass (pylint 10.00, mypy clean).instrukt docs validateandinstrukt docs render --checkpass.main'sitsup/cli.pyandcommands/logs.pyput back on the locked logger,make smokefails withModuleNotFoundError: No module named 'instrukt_ai_logging.cli'; on this head it passes. Without an environment the recipe also exits non-zero.--since,--include,--grep,--follow) were checked againstinstrukt-ai-logs0.10.3 built from its tag.Not verified
journalctlinstructions and the unit names come from the unit files and the existing runtime-operations spec.instrukt-ai-logsis installed on the container host. Before 0.7 the Python package shipped a script of that name; from 0.7 on, a machine needs the standalone tool.api/main.py,bin/monitor.py,bin/backup.py,bin/alert.py) are not started in CI either. They import cleanly here; the guard covers the CLI only.Follow-up
#151 builds on this head. It records why the daemons stay on the journal for now: a root-run process and the itsUP user cannot share the logger's directory without breaking the user's
instrukt-ai-logs itsup, which already applies to the root-run backup job.Host state
Carried over from the earlier description of this PR and not observed in this change: the container host was put on logger 0.6.7 by hand to recover, and its next self-update from
maininstalls whatever the lock holds. Until this merges that is 0.10.2 with a CLI that does not start.