Skip to content

WIP: preserve uncommitted work from server codex-um-1646-completion-audit (fleet commit-push-delete pass 2026-11-12) - #2059

Closed
jaywedgeworth22 wants to merge 9 commits into
mainfrom
codex/um-1646-completion-audit
Closed

jaywedgeworth22 wants to merge 9 commits into
mainfrom
codex/um-1646-completion-audit

Conversation

@jaywedgeworth22

@jaywedgeworth22 jaywedgeworth22 commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Preserves the UM-1646/UM-1651 telemetry completion work and adds durable handling for ambiguous Sentry acknowledgements.

Functional changes

  • Validates Sentry success acknowledgements before advancing delivery state, including partial, malformed, oversized, and incompatible responses.
  • Persists a scrubbed pre-delivery intent so unresolved or partially acknowledged batches remain held instead of being replayed or incorrectly marked delivered.
  • Keeps the Sentry journal offset unchanged while delivery is held, preserves confirmed receipts, and prevents response content from being persisted.
  • Adds focused Node tests for acknowledgements, restarts, compaction, durability failures, rejected records, and mixed trace/log batches.
  • Adds guarded operational tooling for reviewed hub upgrades, collector configuration changes, historical Claude catch-up, inventory updates, and runtime verification. These tools use exact commit or plan digests, compare-and-swap checks, private receipt files, and explicit phase claims where applicable.
  • Adds plan-only configuration tooling for the permanent BotFleet child OpenCode database and workspace settings, while preserving existing configuration bytes and verifying installed collector revisions.
  • Documents the rollout and reconciliation requirements for durable Sentry partial-acknowledgement holds, including rollback behavior and manual reconciliation.

Test evidence

The pull request adds Node and Python fixture-based test coverage and records prior runtime and receipt verification artifacts. The new test suites are not all invoked by the repository test runner, so their execution from this branch is not established by the diff.

Review findings and unresolved risks

Automated review reported 9 findings: 2 critical, 4 high, and 3 medium. They include local .env secret loading, a probe bypassing approved Infisical access, missing schema validation for an approved catch-up plan, base64 compose fallback behavior, journal-counter comparison semantics, execution of the wrong historical catch-up script, private operational evidence committed to the repository, and Python tests not being invoked by the test runner.

The committed artifacts also include operational paths, deployment evidence, and a handoff explicitly marked as private. These require removal or sanitization, and the affected secret-handling, plan-validation, runner, and comparison issues remain unresolved by the supplied changes. Do not treat this branch as approved, production-verified, or safe to deploy until those findings are addressed.


Summary

  • Preserve the uncommitted server-side work for the UM-1646 completion audit, including the Claude historic 24-hour catch-up flow.
  • Validate approved catch-up plans before applying them, requiring the expected commit, source, identity, delivery-configuration digests, and parseable date bounds.
  • Execute the catch-up script alongside its Python launcher so the checked-in implementation is used rather than a hard-coded temporary path.
  • Add the UM-1646 Python fixtures to both standard and coverage test commands, and install PyYAML in the coverage CI job.
  • Update the reviewed Hub upgrade flow to support a structured docker_compose value while retaining the raw-compose fallback.
  • Bump Wrangler from 4.160.0 to 4.160.1.

Validation and review status

The patch adds UM-1646 Python test coverage and CI dependency setup, but the provided changes do not report that these tests or the full suite were run.

The automated review reported three unresolved findings:

  • High: Approved-plan validation in .um1646-claude-historic24h.mjs drops fields required by apply.
  • Medium: npm test now requires PyYAML, but only one CI job installs it.
  • Medium: The live compose fallback in plan-reviewed-hub-upgrade.py bypasses service-shape validation.

These findings should be addressed before relying on the catch-up approval validation, the full test command across all CI jobs, or the live compose fallback.

@linear-code

linear-code Bot commented Nov 12, 2026

Copy link
Copy Markdown

UM-1646

@kody-ai

This comment has been minimized.

@kody-ai

kody-ai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Kody · Business Logic

UM-1646 · Finish telemetry handoff and fix production usage ingest timeouts
4 partial · 5 to check manually · 4 changes not in the task
Task read 2026-11-16 10:27 UTC · at 6c87aea

Requirement In this PR
👀 CHECK MANUALLY Filed from simple-tools AC #1 HANDOFF-UM-1646-2026-11-03.md · This criterion is issue metadata about how the ticket was filed, not a code behavior; the diff cannot prove it. The handoff file references the originating chat and the UM-1646 Linear issue, so confirm on the ticket itself.
👀 CHECK MANUALLY Reported by CODEX AC #2 HANDOFF-UM-1646-2026-11-03.md · Reporting origin is ticket metadata; nothing in the diff can confirm or deny who filed it. The handoff names CODEX as the owning chat.
👀 CHECK MANUALLY App: usage-monitor (team UM) AC #3 .um1651-hub-upgrade-0a92fcfa39f5b576f498dabc43963c89c47b3713.plan.json · App/team attribution is ticket metadata. The diff does work on the usage-monitor telemetry hub and collectors, which is consistent with it, but the app/team fields themselves live on the ticket.
👀 CHECK MANUALLY Severity: P1 AC #4 HANDOFF-UM-1646-2026-11-03.md · Severity is a ticket field; it cannot be verified from the diff.
🟡 PARTIAL Production logs on Oct 30 still show externalUsageEvent.createMany timeouts after UM-1642 deployment. Scope: diagnose and deliver ingest fix Description audit-runtime-metadata.py:20, HANDOFF-UM-1646-2026-11-03.md:1 · The diff provides read-only diagnosis tooling that counts the exact markers (externalUsageEvent.createMany, 'Operation has timed out', writer-busy) in the live container logs, and the handoff asserts the current container shows no such markers. However, there is no ingest-path code change in this diff that fixes the timeout; the receiver fix is attributed to earlier merged PRs, so the fix itself is not delivered here. · Do: Either include the ingest timeout fix (the code that changes the createMany path) in this PR, or reference the merged PR/commit that carries it so the fix is traceable to UM-1646.
✅ MET verify child coverage flag Description .um1646-opencode-child-source-plan-v2.json:21, .um1646-child-pair-apply-ae3a6cbb3461248daad470f024b766a4b11ab189cce28af3894fc96616bb34b7.json:1 · The child-source plan names both runtime keys (OPENCODE_ADDITIONAL_DBS_JSON, BOTFLEET_WORKSPACES_DIRS) with their source-of-truth counterparts, and the apply receipt records readback-verified, confirmed-created, verified_equal states for both keys. The handoff records that the permanent activation stays held pending the AFC-600 scoped write route, so only the verification was performed.
🟡 PARTIAL BotFleet correlation receipt Description final-child-hub-readback.py:1, .um1646-child-pair-apply-ae3a6cbb3461248daad470f024b766a4b11ab189cce28af3894fc96616bb34b7.json:60 · The diff includes a hub readback helper that confirms the exact child event was sent, with zero pending Sentry bytes, plus the two-key apply receipt. But the child correlation itself is only described in the handoff prose (six child events, three token components) and the per-event correlation receipt file is not part of this diff, so the correlation evidence is only partially included. · Do: Include the child correlation receipt (the replayed six-event receipt with the proven DB/session match) so the correlation is verifiable from the repository.
🟡 PARTIAL close Sentry producer coverage gaps Description scripts/telemetry-hub/sentry-sender.mjs:1, scripts/telemetry-hub/journal.mjs:1, scripts/sentry-partial-ack.node-test.mjs:1 · The diff closes the Sentry acknowledgement-validation gap: the sender now validates the OTLP rejection count (including string counts) with a typed hold instead of treating every 2xx as acceptance, and the journal publishes a durable pre-POST intent so ambiguous batches are never replayed, with focused node tests. Other producer coverage named in the handoff (for example the Muse producer) remains explicitly unloaded/pending, so coverage is not fully closed. · Do: Either deliver the remaining producer coverage (Muse/other producers) in this PR, or state which producers are deliberately out of UM-1646 scope and reference their own tasks.
👀 CHECK MANUALLY make duplicate suppression exact and lossless Description HANDOFF-UM-1646-2026-11-03.md:1, scripts/telemetry-hub/journal.mjs:60 · No exact duplicate suppression is implemented in this diff. The handoff states exact suppression must not be enabled without authoritative billed-call proof, and the only dedupe mechanism present (the per-destination sent-id set) is bounded to 10,000 ids and trims the oldest entries, so it is neither exact nor lossless over long windows. · Not found in the files Kody read; part of this PR was too large to read.
🟡 PARTIAL verify historical/backfill and collector CI gaps Description .um1646-claude-historic24h.mjs:1, audit-mac-replay-receipt.py:1, scripts/sentry-partial-ack.node-test.mjs:1 · The diff adds a guarded plan/apply historical Claude catch-up helper (fixed Oct 29-30 window, exact digest binding, no network during planning), a read-only Mac replay receipt reader, and the new Sentry partial-ack test wired into the collector runtime CI gate. The resulting historical receipts and the CI workflow file itself are not in this diff, so the verification results cannot be confirmed from the PR alone. · Do: Include the historical/backfill receipts and the CI workflow change that runs the new test so the verification is reproducible from the repository.
✅ MET Preserve all rows unless exact billed-call evidence exists Description HANDOFF-UM-1646-2026-11-03.md:1, .um1646-claude-historic24h.mjs:70 · No deletion of usage rows is introduced by the diff, and the handoff records that the remaining keeper-absent candidates and rollup groups stay preserved because no exact membership proof authorizes deleting them. The catch-up helper explicitly records zero source writes and zero checkpoint writes.
✅ MET Historical deletion and token rotation decisions remain explicit handoff decision points until checked Description HANDOFF-UM-1646-2026-11-03.md:1, .um1646-opencode-child-source-plan-v2.json:1 · The handoff names both items explicitly: further historical deletion requires recovered membership plus a newly reviewed plan and backup assessment, and the two-key source-of-truth write stays held behind the AFC-600 scoped custody route; the config plans record sourceOfTruthRoute HELD_NOT_IMPLEMENTED and applyAvailable false.
➕ NOT IN TASK Files belonging to the separate UM-1651 hub upgrade task (hub upgrade plans, claim/receipt/stop/repin files, merge and publication receipts) .um1651-hub-upgrade-0a92fcfa39f5b576f498dabc43963c89c47b3713.plan.json:1, .um1651-final-runtime-verification.json:1, .um1651-main-merge-publish-receipt.json:1 · UM-1646 doesn't ask for it. · Move them to the UM-1651 task or drop them from this PR, so UM-1646 contains only its own scope.
➕ NOT IN TASK Generic fleet tooling scripts for publishing, merging and hub image building (publish-reviewed-files.py, publish-um1651-main-merge.py, publish-um1651-merge-gh-fallback.py, publish-um1651-reviewed.py, build-reviewed-hub-image.py, verify-reviewed-hub-image.py, upgrade-reviewed-hub.py, plan-reviewed-hub-upgrade.py, verify-upgraded-hub-and-track.py, recover-verified-stop.py) build-reviewed-hub-image.py:1 · UM-1646 doesn't ask for it. · Reference the task that owns this tooling, or split it into its own PR.
➕ NOT IN TASK Read-only operator tooling unrelated to the UM-1646 scope (inspect-tool-schemas.py, read-current-operations.py, read-final-suppression-flag.py, read-mounted-hub-metadata.py, preserve-final-safe-receipts.py, probe-sentry-empty-ack.py) and the operational audit scripts inspect-tool-schemas.py:1, preserve-final-safe-receipts.py:1 · UM-1646 doesn't ask for it. · Split into a separate tooling PR and reference it, keeping UM-1646 focused on the telemetry handoff.
➕ NOT IN TASK A raw JSON-RPC relay response committed verbatim (.um1646-relay-publication-receipt.json) as a repository file .um1646-relay-publication-receipt.json:1 · UM-1646 doesn't ask for it. · Keep transient transport responses out of the repository and store only the derived receipt.

Disagree with a line? Reply here and mention @kody. Fixed it? Comment @kody -v business-logic and this comment is updated.

Comment thread .um1646-claude-historic24h.mjs Resolved
Comment thread .um1646-claude-historic24h.mjs Resolved
Comment thread .um1646-claude-historic24h.py Resolved
"container_name": "telemetry-hub-a4tp0kk9jmfibzvbmsxvmtqg",
"cpus": 0.5,
"env_file": [
".env"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Kody Rules critical

Compose configuration loads secrets from a local .env file

The Compose env_file list makes the hub load environment-specific values from a local .env, bypassing managed runtime configuration. Remove .env from env_file and inject required values through an approved runtime secret provider instead.

Kody rule violation: No secrets, tokens, or production credentials in Playwright specs or fixtures

Prompt for LLM
File .um1651-hub-upgrade-80f0c92708a21a8a41c4e831187b8235f486d511.plan.json, line 12:

Compose configuration loads secrets from a local .env file

Remove the local `.env` file from the Compose configuration because committed or local `.env` files must not supply environment-specific values. Keep required values in explicitly managed configuration or inject them through an approved runtime secret provider.

Kody rule violation: [No secrets, tokens, or production credentials in Playwright specs or fixtures](https://app.kodus.io/settings/code-review/global/kody-rules/e074be65-1b0b-4061-ae0d-4375d18682cd?teamId=69360e3a-6b41-45d2-9e49-fde78fe49457)

Suggested code:

[]

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Analysis, leaving open for now: the env_file entry sits inside currentCompose - the sha-chained snapshot of the currently deployed service - in all three plan files.  These files carry no rawCompose block, so the current upgrade validator (_plan, which requires rawCompose + rawComposeSha256) would reject them as input; they are review evidence, not executable config.  The upgrade path never propagates env_file: the target environment is a strict allowlist (TELEMETRY_HUB_CONFIG_FILE, TELEMETRY_HUB_BIND_HOST, Coolify generated keys) and no target-construction code references env_file.  Editing the snapshots would falsify evidence and break currentComposeSha256.  Two residual risks remain and are why this is not being resolved as false: (1) the deployed hub does load a local .env today - that is live infra state outside this PR; (2) _plan's unit invariants do not explicitly reject env_file in a future rawCompose - a hardening gap worth closing.  Proposal: track the live .env removal as an infra task and add an explicit env_file rejection to _plan when the file is editable again.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against the branch — your analysis holds, with one factual correction.

Verified

  • The flagged file .um1651-hub-upgrade-80f0c92708a21a8a41c4e831187b8235f486d511.plan.json has keys: configMountSource, currentCompose, currentComposeSha256, durableVolume, metadata, mode, oldContainer, oldImageId, preparedComposeSha256, runtimeChanges, service, serviceStatus, targetCommit, targetImageId, upgradeContract — no rawCompose, and currentCompose.services.telemetry-hub.env_file == [".env"].
  • _plan in upgrade-reviewed-hub.py:160-162 requires rawCompose + a matching rawComposeSha256, so this file is rejected as input by the current validator. It is evidence, not executable config.
  • The upgrade path does not carry env_file forward: in both plans that do carry rawCompose (.um1651-hub-upgrade-0a92fcfa…plan.json and …stale-41ce4cd6.plan.json), rawCompose.services.telemetry-hub.env_file is absent and environment is exactly ['TELEMETRY_HUB_BIND_HOST', 'TELEMETRY_HUB_CONFIG_FILE'] — the strict allowlist. env_file appears only under currentCompose, the sha-chained snapshot of what is deployed today.
  • Editing the snapshot would break currentComposeSha256 and falsify the evidence chain, so it should not be edited.

Correction to one detail

Your claim that all three plan files carry no rawCompose is not accurate — two of the three (0a92fcfa…plan.json, 0a92fcfa…stale-41ce4cd6.plan.json) do include rawCompose/rawComposeSha256 and are valid _plan inputs. The no-rawCompose property is specific to the flagged file. This does not change the conclusion: in both executable plans the target unit has no env_file, so the upgrade itself does not introduce or propagate it.

Residual risk (2) confirmed as real

upgrade-reviewed-hub.py:175-183 asserts image, network_mode, read_only, no ports/networks, and the commit label on rawCompose.services.telemetry-hub — but never rejects env_file. A future plan with a rawCompose carrying env_file would pass _plan validation and reintroduce local .env loading on the upgraded container. That is a genuine hardening gap, distinct from the live-infra risk (1).

Net position

Leave the snapshot as-is; the finding is not a code defect in this PR. Two things remain tracked outside this diff: live removal of the deployed hub's .env dependency, and adding an explicit env_file rejection to _plan's unit invariants (a candidate to add to test_upgrade_reviewed_hub.py alongside the existing plan_original_service_invariants_invalid cases).

Comment on lines +1 to +9
# UM-1646 Telemetry Completion Audit

Private operational evidence.  Do not commit or publish this file.  Updated November 3 at 6:05 AM; work remains active.

## Authority And Coordination

Owner requested reconciliation and completion of the October handoff, current fleet protocols, app changes and economical subagents.  Earlier explicit approvals cover scoped ingest-token rotation, reviewed historical cleanup, server hub activation and BotFleet update/restart.  Preserve startup policy, active work, uncertain telemetry and existing access routes.  No new model request or paid fallback is authorized by the screenshot.

Full chat: `01a18e51-51e1-7093-9269-0901397a9ec1`.  Linear UM-1646 remains claimed CODEX/In Progress.  Work topic: `UM-1614 Telemetry for AI platforms`; resumption post637159462, correction637160564, evidence637161137.  Check inbox without moving sibling cursors and relevant work every 2–3 minutes while peers share the repo, otherwise every 15 minutes, plus turn boundaries.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Security medium

Private operational evidence is exposed in the repository

Committing HANDOFF-UM-1646-2026-11-03.md publishes operational infrastructure, coordination, and filesystem details despite the file's explicit private-only designation. Remove it from this PR and retain it only in the private operations inventory.

Prompt for LLM
File HANDOFF-UM-1646-2026-11-03.md, lines 1-9:

Private operational evidence is exposed in the repository

This file is committed although its own first paragraph states "Private operational evidence. Do not commit or publish this file.", and it enumerates private fleet infrastructure details: absolute server paths (`/mnt/fleet-extra/apps/botfleet-server/...`), Mac host paths (`/Users/jay/apps/...`), internal Linear/topic identifiers, and the sequence of coordination message IDs. Committing it into the product repository publishes operational reconnaissance. Keep it outside the repository (the private operations inventory) and remove it from this PR.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Comment thread plan-reviewed-hub-upgrade.py Resolved
Comment thread probe-sentry-empty-ack.py
raise SystemExit('Expected one known hub')
script = r"""
const fs=require('node:fs'),zlib=require('node:zlib');
const cfg=JSON.parse(fs.readFileSync('/run/secrets/telemetry-hub.json'));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Kody Rules critical

The probe bypasses approved Infisical routes with a direct secret-file read

The probe's direct fs.readFileSync of the mounted secret file bypasses the approved production access path and its scoped policy controls. Replace that read with the hub's scoped Infisical consumer or an approved fleet-secrets lookup.

Also found in:

  • read-mounted-hub-metadata.py:7-7
  • .um1651-hub-upgrade-0a92fcfa39f5b576f498dabc43963c89c47b3713.stale-41ce4cd6.plan.json:12-12
  • .um1646-claude-historic24h.py:6-6
  • .um1651-hub-upgrade-0a92fcfa39f5b576f498dabc43963c89c47b3713.plan.json:22-22
  • .um1646-child-pair-plan.json:119-119
  • child_config_pair_remote.py:212-212
  • .um1646-opencode-child-source-plan-v2.json:39-39
  • configure-opencode-child-source.py:18-18
  • probe-sentry-empty-ack.py:16-16
  • .um1646-claude-historic24h.py:14-14
  • opencode-child-source-plan.py:14-14
  • .um1646-claude-historic24h.py:9-9
  • configure-opencode-child-source.py:95-95
  • child_config_pair_remote.py:153-153
  • test_child_config_local_cas.py:41-46
  • child_config_pair_remote.py:256-256
  • configure-opencode-child-source.py:97-97
  • read-final-suppression-flag.py:5-8
  • test_child_config_local_cas.py:97-100
  • configure-opencode-child-source.py:23-23
  • configure-opencode-child-source.py:104-104
  • .um1646-claude-historic24h.py:10-10
  • child_config_pair_remote.py:236-236
  • sentry-historic-claude-receipts.audit.py:24-25
  • child_config_local_cas.py:19-19
  • child_config_pair_remote.py:317-317
  • configure-opencode-child-source.py:92-92
  • plan-reviewed-hub-upgrade.py:129-129
  • child_config_local_cas.py:21-21
  • child_config_pair_controller.py:36-36
  • child_config_local_cas.py:170-173
  • child_config_local_cas.py:220-223
  • child_config_local_cas.py:343-346
  • .um1651-hub-upgrade-0a92fcfa39f5b576f498dabc43963c89c47b3713.plan.json:101-101
  • upgrade-reviewed-hub.py:221-221
  • child_config_pair_controller.py:37-37
  • opencode-child-source-plan.py:25-25
  • opencode-child-source-plan.py:22-22
  • child_config_pair_remote.py:32-32
  • child_config_pair_remote.py:33-33
  • child_config_local_cas.py:254-254
  • child_config_local_cas.py:303-304
  • child_config_local_cas.py:337-338
  • configure-opencode-child-source.py:101-101
  • child_config_pair_remote.py:29-29
  • child_config_pair_remote.py:28-28
  • child_config_local_cas.py:267-267
  • child_config_local_cas.py:14-14
  • child_config_local_cas.py:311-312
  • plan-reviewed-hub-upgrade.py:41-41
  • child_config_local_cas.py:131-131

Kody rule violation: Load API keys and tokens from approved sources only

Prompt for LLM
File probe-sentry-empty-ack.py, line 14:

The probe bypasses approved Infisical routes with a direct secret-file read

The probe directly reads governed configuration from a mounted secret file rather than obtaining it through an approved Infisical prod route. Replace the direct file read with the hub's scoped Infisical consumer or an approved fleet-secrets lookup so governed values are accessed only through the allowed production path.

**Also found in:**
- `read-mounted-hub-metadata.py:7-7`
- `.um1651-hub-upgrade-0a92fcfa39f5b576f498dabc43963c89c47b3713.stale-41ce4cd6.plan.json:12-12`
- `.um1646-claude-historic24h.py:6-6`
- `.um1651-hub-upgrade-0a92fcfa39f5b576f498dabc43963c89c47b3713.plan.json:22-22`
- `.um1646-child-pair-plan.json:119-119`
- `child_config_pair_remote.py:212-212`
- `.um1646-opencode-child-source-plan-v2.json:39-39`
- `configure-opencode-child-source.py:18-18`
- `probe-sentry-empty-ack.py:16-16`
- `.um1646-claude-historic24h.py:14-14`
- `opencode-child-source-plan.py:14-14`
- `.um1646-claude-historic24h.py:9-9`
- `configure-opencode-child-source.py:95-95`
- `child_config_pair_remote.py:153-153`
- `test_child_config_local_cas.py:41-46`
- `child_config_pair_remote.py:256-256`
- `configure-opencode-child-source.py:97-97`
- `read-final-suppression-flag.py:5-8`
- `test_child_config_local_cas.py:97-100`
- `configure-opencode-child-source.py:23-23`
- `configure-opencode-child-source.py:104-104`
- `.um1646-claude-historic24h.py:10-10`
- `child_config_pair_remote.py:236-236`
- `sentry-historic-claude-receipts.audit.py:24-25`
- `child_config_local_cas.py:19-19`
- `child_config_pair_remote.py:317-317`
- `configure-opencode-child-source.py:92-92`
- `plan-reviewed-hub-upgrade.py:129-129`
- `child_config_local_cas.py:21-21`
- `child_config_pair_controller.py:36-36`
- `child_config_local_cas.py:170-173`
- `child_config_local_cas.py:220-223`
- `child_config_local_cas.py:343-346`
- `.um1651-hub-upgrade-0a92fcfa39f5b576f498dabc43963c89c47b3713.plan.json:101-101`
- `upgrade-reviewed-hub.py:221-221`
- `child_config_pair_controller.py:37-37`
- `opencode-child-source-plan.py:25-25`
- `opencode-child-source-plan.py:22-22`
- `child_config_pair_remote.py:32-32`
- `child_config_pair_remote.py:33-33`
- `child_config_local_cas.py:254-254`
- `child_config_local_cas.py:303-304`
- `child_config_local_cas.py:337-338`
- `configure-opencode-child-source.py:101-101`
- `child_config_pair_remote.py:29-29`
- `child_config_pair_remote.py:28-28`
- `child_config_local_cas.py:267-267`
- `child_config_local_cas.py:14-14`
- `child_config_local_cas.py:311-312`
- `plan-reviewed-hub-upgrade.py:41-41`
- `child_config_local_cas.py:131-131`

Kody rule violation: [Load API keys and tokens from approved sources only](https://app.kodus.io/settings/code-review/global/kody-rules/543a7760-6c23-4656-b6a4-b151c40a46a6?teamId=69360e3a-6b41-45d2-9e49-fde78fe49457)

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Comment thread test_child_config_local_cas.py Resolved
Comment thread upgrade-reviewed-hub.py
Comment on lines +454 to +459
if before_stop:
if actual["pendingBytes"] != 0:
raise fail("journal_pending_bytes_nonzero")
for key in ("journalBase", "journalBytes", "sentryOffset", "pendingBytes"):
if actual[key] != baseline[key]:
raise fail("journal_source_compare_failed")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Bug high

Journal counters are incorrectly compared for exact equality

When the always-on telemetry hub appends between plan creation and shutdown, _old_runtime raises journal_source_compare_failed because it compares journalBase, journalBytes, and sentryOffset for exact equality. Keep stable configSha256, uid, and mode checks exact, require pendingBytes == 0, and reject journal counters only when they fall below their baseline values.

Prompt for LLM
File upgrade-reviewed-hub.py, lines 454-459:

Journal counters are incorrectly compared for exact equality

Before stopping, the phase compares the live `journalBase`, `journalBytes` and `sentryOffset` for exact equality with the values captured in the plan file, but the telemetry hub is an always-on service that keeps appending between plan creation and the stop request (the two plan artifacts in this PR show journalBytes growing 15777089 → 16207767). Any telemetry ingested in that window makes `_old_runtime` abort with `journal_source_compare_failed`, so a legitimate upgrade is refused. Compare only stable properties (configSha256/uid/mode, pendingBytes == 0) and treat the journal counters as monotonic-lower-bound rather than exact equality.

Suggested code:

if before_stop:
    if actual["pendingBytes"] != 0:
        raise fail("journal_pending_bytes_nonzero")
    if (actual["journalBase"] < baseline["journalBase"]
            or actual["journalBytes"] < baseline["journalBytes"]
            or actual["sentryOffset"] < baseline["sentryOffset"]):
        raise fail("journal_source_compare_failed")

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

@kody-ai

kody-ai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Automatic approval held

Kody's assessment:

The risk assessment does not match the current PR or risk settings. Run a new review before automatic approval.

@kody-ai kody-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jaywedgeworth22 and others added 2 commits November 18, 2026 02:07
…before property access, run the reviewed catch-up script via __file__-relative path, parse raw compose through the base64-aware path before deriving the unit, and wire the three Python test suites into npm test with CI PyYAML install.  (Journal-counter floor-check and HANDOFF-doc removal follow in separate commits.)
@kody-ai

kody-ai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

​

Comment on lines +46 to +57
const validateApprovedPlan=value=>{
assert.ok(value&&typeof value==='object'&&!Array.isArray(value),'approved plan must be a JSON object');
const pick={};
for(const key of ['commit','sourceHashDigest','identityDigest','deliveryConfigDigest','lower','upper']){
assert.ok(typeof value[key]==='string','approved plan string field missing: '+key);
pick[key]=value[key];
}
assert.match(pick.commit,/^[a-f0-9]{40}$/,'approved plan commit shape');
for(const key of ['sourceHashDigest','identityDigest','deliveryConfigDigest'])assert.match(pick[key],/^[a-f0-9]{64}$/,'approved plan digest shape: '+key);
assert.ok(Number.isFinite(Date.parse(pick.lower))&&Number.isFinite(Date.parse(pick.upper)),'approved plan dates must parse');
return pick;
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Bug high

Approved plan validation drops fields required by apply

Revises an earlier Kody suggestion on .um1646-claude-historic24h.mjs:50 (2026-11-16 10:42 UTC).

validateApprovedPlan returns a pick object with only six keys, dropping selectedDigest, components and callMarkers that the plan writer emits and the apply branch asserts against, so every apply run aborts with assert.equal(selectedDigest, undefined) and the 24h catch-up never delivers. Validate those fields too — selectedDigest as a 64-character hex digest and components and callMarkers as non-negative safe integers — and copy them into pick so the approved-plan checks stay meaningful.

Prompt for LLM
File .um1646-claude-historic24h.mjs, lines 46-57:

**Revises an earlier Kody suggestion** on `.um1646-claude-historic24h.mjs:50` (2026-11-16 10:42 UTC).

Approved plan validation drops fields required by apply

The new `validateApprovedPlan` returns only a six-key `pick` object, dropping `selectedDigest`, `components` and `callMarkers` that the plan writer emits (lines 83-84) and that the apply branch asserts against (`approved.selectedDigest`, `approved.components`, `approved.callMarkers` at lines 90-92). Since those properties are now `undefined`, every `apply` run aborts with `assert.equal(selectedDigest, undefined)` and the 24h catch-up never delivers — a silent, always-failing regression introduced by this PR. Validate those fields too (e.g. require them as strings/numbers with the expected shapes and copy them into `pick`) so the approved-plan checks remain meaningful.

Suggested code:

const validateApprovedPlan=value=>{
  assert.ok(value&&typeof value==='object'&&!Array.isArray(value),'approved plan must be a JSON object');
  const pick={};
  for(const key of ['commit','sourceHashDigest','identityDigest','deliveryConfigDigest','selectedDigest','lower','upper']){
    assert.ok(typeof value[key]==='string','approved plan string field missing: '+key);
    pick[key]=value[key];
  }
  assert.match(pick.commit,/^[a-f0-9]{40}$/,'approved plan commit shape');
  for(const key of ['sourceHashDigest','identityDigest','deliveryConfigDigest','selectedDigest'])assert.match(pick[key],/^[a-f0-9]{64}$/,'approved plan digest shape: '+key);
  for(const key of ['components','callMarkers']){
    assert.ok(Number.isSafeInteger(value[key])&&value[key]>=0,'approved plan count field invalid: '+key);
    pick[key]=value[key];
  }
  assert.ok(Number.isFinite(Date.parse(pick.lower))&&Number.isFinite(Date.parse(pick.upper)),'approved plan dates must parse');
  return pick;
};

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Comment thread package.json
"verify": "npm run test:node-runtime && npm run test:sentry-ci-report && npm run test:security-ancestry && npm run lint && npm run typecheck && npm test && npm run test:receipt-inbox-worker && npm run test:expenses-worker && npm run test:migrate-safe && npm run test:sqlite-backup && npm run test:backup-concurrent-startup && npm run test:r2-archive && npm run test:startup-config && npm run test:oracle-deploy && npm run test:apple-projects && npm run test:antigravity-collector && npm run test:session-token-collectors && npm run test:collector-runtime && npm run test:cf-token-map && npm run test:replica-status-probe && npm run test:quota-wrapper && npm run test:audit-ci && npm run build",
"test:security-ancestry": "python3 scripts/telemetry-hub/test_audit_security_ancestry.py"
"test:security-ancestry": "python3 scripts/telemetry-hub/test_audit_security_ancestry.py",
"test:um1646-python": "python3 test_child_config_local_cas.py && python3 test_um1646_inventory_update_fixture.py && python3 test_upgrade_reviewed_hub.py"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Fleet Recall context medium

npm test now requires PyYAML but only one CI job installs it

The test:um1646-python script runs test_upgrade_reviewed_hub.py, which imports yaml at module scope, so npm test needs PyYAML that is declared in no committed requirements file and is installed only by the ad-hoc pip step in the coverage job in .github/workflows/ci.yml. Other npm test consumers — npm run verify and the autofix workflow in .github/workflows/claude-code-autofix.yml — abort with ModuleNotFoundError: No module named 'yaml', failing the whole verify chain even when the JavaScript suites pass; declare PyYAML in a committed requirements file and install it wherever npm test runs, or move the Python suites out of npm test into a separate script that CI invokes after installing the dependency.

Prompt for LLM
File package.json, line 77:

npm test now requires PyYAML but only one CI job installs it

`test:um1646-python` runs `test_upgrade_reviewed_hub.py`, which imports `yaml` at module scope (test_upgrade_reviewed_hub.py:19), so `npm test` now needs PyYAML, but PyYAML is not declared anywhere in the repo (no requirements.txt/pyproject.toml) and the only install is the ad-hoc pip step added inside the coverage job at .github/workflows/ci.yml:235-236. Every other consumer of `npm test` — `npm run verify` (package.json:75) and the autofix reusable workflow whose verify command is `npm run typecheck && npm run lint && npm test` (.github/workflows/claude-code-autofix.yml:43) — has no PyYAML install step, so those runs abort with `ModuleNotFoundError: No module named 'yaml'` and the whole verify chain fails even when the JavaScript suites pass. Declare the dependency in a committed requirements file and install it wherever `npm test` runs (add the same pip install step to the autofix/verify paths), or keep the Python suites out of `npm test` and expose them as a separate `npm run test:um1646-python` script that CI invokes explicitly after installing PyYAML.

Suggested code:

"test:um1646-python": "python3 test_child_config_local_cas.py && python3 test_um1646_inventory_update_fixture.py && python3 test_upgrade_reviewed_hub.py",
"pretest:um1646-python": "python3 -m pip install --break-system-packages -r requirements-test.txt"

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Comment on lines +57 to +61
compose_value = current.get("docker_compose")
compose = yaml.safe_load(compose_value) if isinstance(compose_value, str) and compose_value else raw_compose
if not isinstance(compose, dict) or "services" not in compose:
raise SystemExit('Current compose shape is unsupported')
unit = compose["services"]["telemetry-hub"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Bug medium

Live compose fallback bypasses service-shape validation

Revises an earlier Kody suggestion on plan-reviewed-hub-upgrade.py:45 (2026-11-16 10:42 UTC).

The compose resolution falls back to raw_compose whenever docker_compose is missing or not a string, so the live service-shape gate validates the original raw compose instead of the live service, letting a drifted live compose (different image, ports, env keys) pass and the plan be built from stale data. Require docker_compose to be present and parseable with a distinct failure message, and guard compose["services"]["telemetry-hub"] with a membership check so a missing key fails loudly instead of raising an uncaught KeyError.

Prompt for LLM
File plan-reviewed-hub-upgrade.py, lines 57-61:

**Revises an earlier Kody suggestion** on `plan-reviewed-hub-upgrade.py:45` (2026-11-16 10:42 UTC).

Live compose fallback bypasses service-shape validation

The new compose resolution silently falls back to `raw_compose` whenever `docker_compose` is missing or not a string, so the whole "live service shape differs; inspect without changing it" gate (lines 68-87) then validates the *original* raw compose instead of the live service. A service whose live compose has drifted (different image, ports, env keys) passes the gate and the plan is built from stale data, which is exactly the check the script exists to perform. Require `docker_compose` to be present and parseable (fail with a distinct message when the API omits it) rather than substituting the raw copy; additionally guard `compose["services"]["telemetry-hub"]` with a membership check so a missing key fails loudly instead of raising an uncaught KeyError.

Suggested code:

compose_value = current.get("docker_compose")
if not isinstance(compose_value, str) or not compose_value:
    raise SystemExit('Live compose is unavailable; preserve the service')
try:
    compose = yaml.safe_load(compose_value)
except yaml.YAMLError:
    raise SystemExit('Live compose is unparseable; preserve the service')
if not isinstance(compose, dict) or not isinstance(compose.get("services"), dict):
    raise SystemExit('Current compose shape is unsupported')
if "telemetry-hub" not in compose["services"]:
    raise SystemExit('Current compose service membership changed')
unit = compose["services"]["telemetry-hub"]

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

@swu-rob

swu-rob Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Closing as not beneficial / superseded in substance under the owner's fleet-wide PR sweep (Nov 22, 2026), after a full read of the body, files, and all review threads and a semantic comparison against current main.

Evidence:

  • Against the current merge-base this draft changes 66 files, and every one is repo-root salvage from the Nov 12 commit-push-delete pass: .um1646-/.um1651- plan, claim and receipt JSONs for already-executed operations, HANDOFF-UM-1646-2026-11-03.md (explicitly private), and one-off operational scripts (upgrade-reviewed-hub.py, prepare-um1646-inventory-update.py, child_config_.py, publish-.py, probe-sentry-empty-ack.py), plus a Wrangler patch bump in package.json and a 3-line CI change.  No product source file is changed.
  • The substantive product work from this branch's own fix commits (OpenCode collector profile collection, removal of scripts/lib/fleet-secrets.mjs) is already on main: those files no longer appear in the diff against the current merge-base, and scripts/lib/fleet-secrets.mjs returns 404 on main.
  • The branch is in a dirty (conflicting) state against current main, and 7 of its 12 review threads are unresolved, including findings on upgrade-reviewed-hub.py, probe-sentry-empty-ack.py, .um1646-claude-historic24h.mjs, plan-reviewed-hub-upgrade.py, and the private-data security thread on the handoff file.  The PR's own summary records 9 automated-review findings (2 critical, 4 high, 3 medium), including local .env secret loading, a probe bypassing approved Infisical access, and private operational evidence committed to the repository.
  • The operations these plans and receipts describe already ran; landing their artifacts on main preserves nothing executable and would republish material review flagged as private.

The one arguably reusable artifact, scripts/test_ops_synced_credentials.py, belongs with the UM-1676 synced-credentials work (see PR #2083) and can be re-created fresh there if that work proceeds; it does not justify landing this salvage bundle.  [MA]

@swu-rob swu-rob Bot closed this Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant