Repository navigation
Salvage Telemetry Hub Offline Lifecycle Work - #1896
Conversation
Untracked offline engine runtime, pinned and finite lifecycle, host proof adapter, Kimi and Z Code activation controller, mounted source sync, rehearsals and four runbooks, with their Python tests. Recovered from the codex-sentry-bundler-release lane (UM-1651, related UM-1614). Refs AFC-618, UM-1651 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…; regenerate custody source pin in verify-absence.py. runtime-dependencies duplicates were intentionally omitted; pinned hashes unchanged (byte-identical contents). Fixes custody test collection.
…rite test forces a guaranteed stat-signature delta (coarse-tick filesystems can mask a fast same-tick rewrite; production tmpfs parent has ns granularity), cleanup tests skip explicitly when the intentionally unmirrored private cleanup-manifest.json is absent instead of failing.
This comment has been minimized.
This comment has been minimized.
…se-tick collision case
|
Runbooks conflict on the current test count
Kody rule violation: Preserve verification records Prompt for LLM |
…w question, no granularity guarantee
…ansport close. Container now emits only the mounted snapshot SHA-256; host compares digests and returns the private host snapshot, so raw mounted secrets never transit subprocess stdout (Kody critical). ReadOnlyEngine closes each fully read response so same-connection reuse works across runtimes. Pins refreshed; digest-contract tests added; suites green (138 passed, 2 skipped).
|
@kody start-review - head 1dc511d resolves the mounted-secret stdout finding: the container now emits only the snapshot SHA-256 and the host compares digests, returning the private host snapshot. ReadOnlyEngine also closes fully read responses for cross-runtime connection reuse. Suites green (138 passed, 2 skipped). |
This comment has been minimized.
This comment has been minimized.
…e close. DeadlineSocket now serves one shared buffered reader whose response-level close is teardown-free, so bytes already read ahead for the next response survive; the explicit response.close() from 1dc511d only detaches the response. Pipelined worst-case regression added (content-length/chunked/mixed); pins refreshed; suites green (139 passed, 2 skipped).
…ces the receiver's verified 1..64 limit; collector tokens write/read back at '/' (FLEET_SECRETS_PATHS searches only '/' and '/global-api-keys'); invariant digest uses canonical resolved_invariants with compact sorted JSON; fixture API version derives from PREFIX; same_json for archive-read/projection comparisons; runbooks aligned to verified 122/120/2. Pins refreshed; suites green.
…t + receiver parity test (WWai); runbook token path /telemetry -> / (WWgS); custody quarantine skips only the strengthened signal, ordinary failures re-raise (WWlz); dependency fence pins re-derived for the new sources. Suites green (122+2sk incl new parity test; custody 19/19).
…ous fixture-digest assertions Only the host/container digest mismatch proves the recreated container serves the pre-replacement inode, so inspection or command failures raised by mounted() now propagate unchanged instead of inheriting the no-rollback content-mismatch Stop. Adds a regression test for that path and removes two test assertions that only re-checked the test's own digest of its fixture.
|
@kody start-review Follow-up review request for the new head 842de32: it addresses the medium finding on the post-replacement |
This comment has been minimized.
This comment has been minimized.
Non-digest mounted() failures after replacement now read as an unverified post-replacement readback, preserving cause and no-rollback guidance. Custody quarantine re-raises only receipt failures. PINS, verify-absence and runbook SHA-256 fences regenerated; suites green (22+2 skips, 19).
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Counts verified by running the suites at this head: custody 19 tests pass (doc said seventeen); top-level telemetry suite 125 tests, 123 passes, 2 existing UID-assignment skips (doc said 118/116/2). File hash pins unchanged and re-verified.
Per the review finding, the lane rehearsal directories' own plans mark them not cleared for publication, so this removes the three rehearsals/ trees from the tracked diff and aligns the custody runbook text with what is published. The custody controller test also becomes platform-honest: on macOS the temp prefix crosses the /var symlink, which the walker refuses by design, so that case skips there while Linux CI exercises the full path. Refs AFC-618, UM-1651.
Refs AFC-618, UM-1651
Summary
This PR salvages the reviewed Telemetry Hub activation and lifecycle work for Kimi Code and ZCode while preserving the original finite credential-use, ownership, custody, one-writer, and production-release gates. It adds a canonical secret/map controller, offline mounted-snapshot planning, finite Engine lifecycle models, and synthetic rehearsal evidence without activating production or changing the running hub. Kimi Code and ZCode telemetry therefore remains disabled unless the canonical controller is separately reviewed and released.
Functional changes
Added
activate-kimi-zcode.py, whose default mode produces a metadata-only plan with no network requests, credential consumption, token generation, or writes. A separately authorized execution requires an exact reviewed manifest digest, acknowledged AFC-600 and Clutch reservations, the four existing production-scoped grants, unchanged baseline digests and membership, and no pre-existing requested keys. It provisions four independent ingest/hub tokens, preserves existing root-map members and hub tuples, and reads back every write and map change. Private owner-only custody and intent, confirmation, and completion receipts are written before remote mutations, with no automatic retry or rollback.Added
sync-mounted-sources.pyto plan a mounted snapshot replacement that changes only the canonical hub map, preserves Sentry fields and existing producers, backs up the old snapshot, checks for competing changes, retains UID/GID10001:10001and mode0600, and verifies journal continuity. The CLI rejects live execution, and the real stop and recreation operations remain intentionally unavailable.Added a pinned Engine lifecycle stack comprising
pinned-engine-lifecycle.py,finite-pinned-lifecycle.py,host-proof-adapter.py, andoffline-engine-runtime.py. These offline models define exact API1.53routes, bodies, statuses, request budgets, daemon identity checks, connection deadlines, wire limits, four one-shot proof phases, durable receipt requirements, recovery backups, journal fingerprints, and strict snapshot-archive decoding without filesystem extraction. The supplied real Engine transport remains GET-only, while the mounted reader and live mutation routes continue to refuse execution.Added resolved-mount normalization by unique destination while retaining every mount field and nested value, plus
check-engine-invariant-predicate.pyfor source-only comparison of candidate invariant predicates.Added synthetic stopped-archive, exact-cleanup, and UID-custody rehearsal candidates. These cover stopped-container representation checks, archive upload/readback, cleanup ordering, UID
10001:10001file custody, fault handling, and unarmed absence verification. The published copies are redacted or hash-fenced and do not authorize fixture execution.Added runbooks covering canonical activation, offline Engine runtime review, production-shaped rehearsal requirements, and isolated UID-custody preparation. The intent is to preserve prior review baselines rather than silently refresh them; audit
637271298, coordination request637275091, controller requests637276421and637276431, and historical runtime owner receipt637291577remain the recorded context, with current reservations still requiring refresh before any future execution.Operational impact and safety
No production activation, hub restart, container stop/recreation, source-token deployment, Sentry delivery, or Usage Monitor ledger acceptance is performed or demonstrated by this PR. Unknown write outcomes terminate without retry, rollback, or automatic cleanup, and private receipts or remaining resources are retained for reconciliation. Snapshot replacement still relies on cooperative ownership and compare-before-rename; it is not atomic compare-and-swap against a writer that ignores the protocol.
The mounted and runtime candidates provide rehearsal and review evidence only. Synthetic success does not establish the production image or field set, Compose and environment provenance, host-network behavior, production UID custody, journal continuity, sender acceptance, stored Sentry receipts, or Usage Monitor acknowledgment and ledger evidence.
Tests and reported evidence
Added tests cover canonical activation boundaries, mounted snapshot replacement, finite lifecycle ordering, durable host proofs, strict archive parsing, Engine transport limits, stopped-archive representation, cleanup faults, and UID custody. The new tests use fake daemons, fake sockets, synthetic archives, and temporary files rather than live Engine or production resources.
No current test execution output was provided with the diff. The added runbooks report the latest full suite as 118 tests with 116 passes and two existing UID-assignment skips, while retaining an earlier scoped 98-test boundary with 96 passes and two skips. Rehearsal plans separately report 16 stopped-archive tests, nine prior rehearsal tests, six cleanup tests, and 17 UID-custody tests. The cleanup test module expects an intentionally unmirrored private manifest, so its public-checkout behavior must not be conflated with the private-package result.
The runbooks also cite prior separately released synthetic Engine evidence, including receipt
637300465for stopped public-image fixtures and confirmed cleanup. That evidence applies only to the selected synthetic configuration, image, daemon, and API and does not establish production equivalence.The documented validation command is:
python3 -m unittest discover -s scripts/telemetry-hub -p 'test_*.py' -vAutomated review findings
The automated review reported nine findings that remain visible in the supplied changes:
sync-mounted-sources.pyemits mounted secret configuration through captured subprocess stdout.activate-kimi-zcode.pydoes not enforce the receiver's 64-member hub-map limit.activate-kimi-zcode.pywrites collector token secrets under/telemetry, although no collector reads that path.stopped-archive-c4e91b27review copies conflict with their own instruction not to publish those lane artifacts.uid-custody-73b4d9e0/fixture-base.pyduplicates the API version instead of deriving it from the canonical prefix.sync-mounted-sources.pycomputes its container invariant digest from a different projection than the canonical resolved invariant, allowing mount ordering and normalization to disagree.stopped-archive-c4e91b27comparison uses type-loose equality that can hide boolean, integer, and float configuration drift.telemetry-hub-production-shaped-rehearsal.mdcites a 113-test boundary while pointing to 118 tests.These findings, together with the remaining production gates, block treating the current artifacts as an activation receipt or authorization for live mutation.
Summary
Salvages the UM-1651 telemetry-hub offline lifecycle work by tightening mounted-secret handling, supporting pinned-engine connection reuse, and expanding UID custody rehearsal coverage.
Test Evidence
The rehearsal plan reports a prior run of seventeen offline tests using fake daemon and wire responses with synthetic data. The two additional UID-custody tests are included in the patch but are not covered by that run evidence; the plan’s seventeen-test count is now stale. No new run result is provided by these changes.
Review Findings and Unresolved Risks
Summary
This PR salvages the UM-1651 telemetry hub offline lifecycle work without enabling production routes or releasing a production rehearsal. It corrects activation secret placement, hardens offline transport and snapshot verification, and updates the associated custody evidence.
/, where collectors resolve secrets;/telemetrynow contains only the hub source map.Validation
Coverage was added or strengthened for root-level token placement and mutation detection, pipelined Engine responses, canonical digest handling, and preservation of the no-rollback instruction.
The updated runbooks report a 122-test full suite with 120 passes and two existing UID-assignment skips, including five mount-normalization regressions. The UID custody plan separately reports 19 offline tests passing with fake daemon/wire responses and synthetic operator files. No production Docker operation, production rehearsal, or production mutation was run, and all production runtime routes remain disabled.
Open Review Findings
The automated review reported five findings that remain unresolved in the shown changes:
evidence.check()failure into a skip, potentially hiding unrelated custody failures./telemetry, contrary to the new root-level placement.Production binary readers and mutation transports remain unwired. Production recovery, journal and custody evidence, real Engine archive acceptance, and sender/Sentry/Usage Monitor acknowledgement and ledger acceptance remain separate gates; cooperative compare/rename races, nonpreemptible kernel I/O, and the stat-only timestamp-collision boundary also remain open limitations.
Summary
This PR salvages the telemetry-hub offline lifecycle work for UM-1651 by correcting the Kimi/Zcode activation guidance and tightening rehearsal safeguards around receiver limits, custody integrity, and post-replacement failures.
/scope instead of/telemetry.otlp-receiver.mjs; the current receiver limit remains unchanged.Test changes
The supplied changes do not report test execution, deployment, or runtime verification.
Unresolved review findings
The automated review reported four findings that are not shown as resolved in the supplied patches:
sync-mounted-sources.pyfrom before its latest change.Summary
Updates the UM-1651 Telemetry Hub offline lifecycle work so readback failures after mounted sources have already been replaced always direct operators to reconcile without rollback, avoiding a potential custody fork. The custody rehearsal remains hash-pinned, offline, and separate from production enablement.
Changes
Testing
The runbook reports 17 offline custody tests passing in both the lane and private package, including fake success at 27 wire requests/three mutations and a separate unarmed five-wire absence readback. It also reports the top-level telemetry suite at 118 tests with 116 passes and two existing UID-assignment skips.
These are documented results rather than independently verified execution. The automated review’s outstanding low-severity finding notes that the runbook test counts conflict with the refreshed artifact digests, leaving the reported pass status for those refreshed artifacts unverified.
Boundaries and Remaining Work
Reported validation used fake daemon/wire responses, temporary operator files, and test-only UID metadata substitution; no
chown, real socket, fixed RAM scope, or installed-daemon query occurred. The probe’s evidentiary scope remains limited to synthetic UID-10001 host custody. Independent review and a separate exact release remain pending, and no production gate is weakened or enabled by this implementation.