Harden Hermes chat continuity and activity rendering #21

Manually merged
atlas-reconciler merged 0 commits from feature/hermes-chat-smoothness into main 2026-08-18 21:28:01 +00:00

Intended reviewer: Brad (brad_stein). Gitea currently rejects the review request because that account cannot read this repository; repository access must be granted before the reviewer can be attached.

Summary

  • bound Telegram response continuity to a durable compact summary plus recent turns, repair Telegram source labels, rotate week-idle topics deterministically, and delete exact replay rows only
  • keep Telegram typing activity alive during long work, preserve real media delivery while scrubbing private paths, and make inbound-versus-generated image edit capability explicit
  • add an accessible chat session fallback that follows resume lineage, reports persisted activity, retries disconnects, and bounds its poll projection independently of the deployed WebUI version

Audit and scope

  • read-only live audit completed; no live session data was mutated
  • zero file overlap with the exact current heads of PRs #14-#17 or feature/hermes-distributed-worker-pool
  • chat tenant/router only; agent.hermes, triage.hermes, Switchyard routes, and manual overrides remain unchanged
  • the requested HERMES_ATLAS_MIGRATION_HANDOFF.md is absent from repository history; the related Hermes handoff acceptance document was reviewed instead

Validation

  • 55 focused Hermes tests passed; migration/compactor coverage 99%, API patcher 100%
  • router Go tests, race tests, and vet passed; new executable Go source coverage 96.4%
  • full repository unit suite: 373 passed
  • Kustomize render/client validation and Flux-controller server-side dry-runs passed
  • Ruff, JavaScript syntax, diff, protected-file overlap, and high-confidence secret scans passed

Existing repository finding

The full local quality gate still reports its pre-existing >500 LOC hygiene findings in four unrelated test files; docs, smell, unit, and coverage checks pass. Every changed production file and the new Python test file remain below 500 LOC.

No merge, deploy, Flux reconciliation, image publication, real Telegram call, or live-data mutation was performed.

> Intended reviewer: Brad (`brad_stein`). Gitea currently rejects the review request because that account cannot read this repository; repository access must be granted before the reviewer can be attached. ## Summary - bound Telegram response continuity to a durable compact summary plus recent turns, repair Telegram source labels, rotate week-idle topics deterministically, and delete exact replay rows only - keep Telegram typing activity alive during long work, preserve real media delivery while scrubbing private paths, and make inbound-versus-generated image edit capability explicit - add an accessible chat session fallback that follows resume lineage, reports persisted activity, retries disconnects, and bounds its poll projection independently of the deployed WebUI version ## Audit and scope - read-only live audit completed; no live session data was mutated - zero file overlap with the exact current heads of PRs #14-#17 or feature/hermes-distributed-worker-pool - chat tenant/router only; agent.hermes, triage.hermes, Switchyard routes, and manual overrides remain unchanged - the requested HERMES_ATLAS_MIGRATION_HANDOFF.md is absent from repository history; the related Hermes handoff acceptance document was reviewed instead ## Validation - 55 focused Hermes tests passed; migration/compactor coverage 99%, API patcher 100% - router Go tests, race tests, and vet passed; new executable Go source coverage 96.4% - full repository unit suite: 373 passed - Kustomize render/client validation and Flux-controller server-side dry-runs passed - Ruff, JavaScript syntax, diff, protected-file overlap, and high-confidence secret scans passed ## Existing repository finding The full local quality gate still reports its pre-existing >500 LOC hygiene findings in four unrelated test files; docs, smell, unit, and coverage checks pass. Every changed production file and the new Python test file remain below 500 LOC. No merge, deploy, Flux reconciliation, image publication, real Telegram call, or live-data mutation was performed.
hermes-automation added 1 commit 2026-08-17 14:40:15 +00:00
hermes-automation added 1 commit 2026-08-17 14:42:09 +00:00
Author
Member

Continuation acceptance evidence — 2026-08-17

Exact head: c943ad453780e6e2bacb2506b1217bdd9107f97d.

Required adversarial cases

  • Existing-session migration idempotence, Telegram source labels, and exact stored replay deletion: test_existing_session_migration_repairs_labels_and_is_idempotent.
  • Summary/recent-turn bounds, deterministic duplicate suppression, private attachment redaction, and malformed/oversized histories: test_context_is_deterministic_bounded_deduplicated_and_truthful, test_context_rejects_malformed_history_and_bounds_single_large_item, test_context_defensive_normalization_and_replay_edges, and test_context_final_serialized_size_guard.
  • Missing/corrupt/oversized persistence inputs and transactional rollback: test_migration_fails_closed_on_missing_or_malformed_databases and test_migration_skips_invalid_conversation_and_rolls_back_database_errors.
  • Streaming/poll disconnect persistence: test_api_patch_compacts_input_batch_and_disconnect_snapshots plus TestSessionContinuityAssetHasAccessiblePollFallback.
  • Blank/inaccessible render fallback, auth resume, lineage-preserving resolved session ID, bounded poll, malformed/oversized poll body, and native-WebSocket non-interference: TestSessionContinuityAssetHasAccessiblePollFallback, TestSessionContinuityPollIsBoundedByRouter, and all four TestBoundSessionSnapshot* cases.
  • Hour/day/exact-week resume, post-week topic reuse/rotation, and router restart: TestTelegramTopicContinuityExpiresOnlyAfterIdleWeek; legacy topic identity and privacy are covered by TestTelegramTopicValidationAndLegacyGeneralConversation and TestTelegramTopicsPersistWithoutStoringTelegramIdentity.
  • Progressive long-work activity and cancellation safety: TestTelegramActivityRepeatsAndStops and TestTelegramActivityStopCancelsInflightRequest.
  • Image-edit truthfulness for current inbound photos versus prior Hermes-generated artifacts: TestTelegramImageEditPromptStatesTransportBoundary and TestTelegramImageRequestStreamsMultimodalInput.
  • Outbound Telegram media/caption delivery and MEDIA/private-path safety: TestParseTelegramReplyRemovesOneOrMoreInternalMarkers, TestParseTelegramReplyScrubsMalformedMarkersAndBarePrivatePaths, TestSendReplyUploadsPhotoWithCaptionThroughTenantAuth, TestSendReplyUploadsMultipleMarkersAndCaptionsOnlyFirst, TestSendReplySendsLongCaptionSeparately, TestSendReplyRejectsTraversalWithoutFetchingTenant, and TestSendReplyUsesOnlyLinkedTenantSlot.
  • Tenant isolation: TestSubjectsReceiveStableIsolatedSlots, test_chat_mounts_continuity_only_into_isolated_tenants, and test_sandbox_shares_only_the_tenant_workspace_without_credentials.
  • Switchyard routes/manual overrides: nine targeted chat/auto-router tests passed, including test_cli_exact_manual_route_remains_exact_across_boundaries, test_manual_command_persists_a_switchyard_route_not_a_direct_provider, and test_switchyard_owns_fallbacks_and_auto_clears_static_effort.

Fresh verification results

  • Focused Python adversarial suite: 15 passed; migration/compactor 98%, patcher 100%.
  • Targeted Go adversarial suite: all named cases passed; full go test -race passed; go vet passed; new executable Go source 96.4%.
  • Full repository unit suite: 373 passed.
  • Full configured Ruff check and focused format check passed; browser JavaScript syntax passed.
  • Hermes Kustomize/client dry-run and Flux kustomize-controller server-side dry-runs passed.
  • Current PR #14-#17 and distributed-pool overlap scan: 0 overlaps across 16 changed versus 257 protected files.
  • Committed diff check and high-confidence secret scan passed. Every changed production file and the new Python test is below 500 LOC.

Read-only live reinspection

Router is 1/1 and tenant StatefulSet is 8/8; last two hours contain zero tenant-backend-unavailable and zero Telegram failure matches. API sessions currently labeled Unassigned: zero. The undeployed live Telegram chain remains 2,516 items / 1,943,119 bytes, confirming the bounded-history change is still evidence-backed. No live data, deployment, Flux state, Telegram endpoint, or image was mutated.

## Continuation acceptance evidence — 2026-08-17 Exact head: `c943ad453780e6e2bacb2506b1217bdd9107f97d`. ### Required adversarial cases - Existing-session migration idempotence, Telegram source labels, and exact stored replay deletion: `test_existing_session_migration_repairs_labels_and_is_idempotent`. - Summary/recent-turn bounds, deterministic duplicate suppression, private attachment redaction, and malformed/oversized histories: `test_context_is_deterministic_bounded_deduplicated_and_truthful`, `test_context_rejects_malformed_history_and_bounds_single_large_item`, `test_context_defensive_normalization_and_replay_edges`, and `test_context_final_serialized_size_guard`. - Missing/corrupt/oversized persistence inputs and transactional rollback: `test_migration_fails_closed_on_missing_or_malformed_databases` and `test_migration_skips_invalid_conversation_and_rolls_back_database_errors`. - Streaming/poll disconnect persistence: `test_api_patch_compacts_input_batch_and_disconnect_snapshots` plus `TestSessionContinuityAssetHasAccessiblePollFallback`. - Blank/inaccessible render fallback, auth resume, lineage-preserving resolved session ID, bounded poll, malformed/oversized poll body, and native-WebSocket non-interference: `TestSessionContinuityAssetHasAccessiblePollFallback`, `TestSessionContinuityPollIsBoundedByRouter`, and all four `TestBoundSessionSnapshot*` cases. - Hour/day/exact-week resume, post-week topic reuse/rotation, and router restart: `TestTelegramTopicContinuityExpiresOnlyAfterIdleWeek`; legacy topic identity and privacy are covered by `TestTelegramTopicValidationAndLegacyGeneralConversation` and `TestTelegramTopicsPersistWithoutStoringTelegramIdentity`. - Progressive long-work activity and cancellation safety: `TestTelegramActivityRepeatsAndStops` and `TestTelegramActivityStopCancelsInflightRequest`. - Image-edit truthfulness for current inbound photos versus prior Hermes-generated artifacts: `TestTelegramImageEditPromptStatesTransportBoundary` and `TestTelegramImageRequestStreamsMultimodalInput`. - Outbound Telegram media/caption delivery and MEDIA/private-path safety: `TestParseTelegramReplyRemovesOneOrMoreInternalMarkers`, `TestParseTelegramReplyScrubsMalformedMarkersAndBarePrivatePaths`, `TestSendReplyUploadsPhotoWithCaptionThroughTenantAuth`, `TestSendReplyUploadsMultipleMarkersAndCaptionsOnlyFirst`, `TestSendReplySendsLongCaptionSeparately`, `TestSendReplyRejectsTraversalWithoutFetchingTenant`, and `TestSendReplyUsesOnlyLinkedTenantSlot`. - Tenant isolation: `TestSubjectsReceiveStableIsolatedSlots`, `test_chat_mounts_continuity_only_into_isolated_tenants`, and `test_sandbox_shares_only_the_tenant_workspace_without_credentials`. - Switchyard routes/manual overrides: nine targeted chat/auto-router tests passed, including `test_cli_exact_manual_route_remains_exact_across_boundaries`, `test_manual_command_persists_a_switchyard_route_not_a_direct_provider`, and `test_switchyard_owns_fallbacks_and_auto_clears_static_effort`. ### Fresh verification results - Focused Python adversarial suite: **15 passed**; migration/compactor **98%**, patcher **100%**. - Targeted Go adversarial suite: all named cases passed; full `go test -race` passed; `go vet` passed; new executable Go source **96.4%**. - Full repository unit suite: **373 passed**. - Full configured Ruff check and focused format check passed; browser JavaScript syntax passed. - Hermes Kustomize/client dry-run and Flux `kustomize-controller` server-side dry-runs passed. - Current PR #14-#17 and distributed-pool overlap scan: **0 overlaps** across 16 changed versus 257 protected files. - Committed diff check and high-confidence secret scan passed. Every changed production file and the new Python test is below 500 LOC. ### Read-only live reinspection Router is 1/1 and tenant StatefulSet is 8/8; last two hours contain zero tenant-backend-unavailable and zero Telegram failure matches. API sessions currently labeled Unassigned: zero. The undeployed live Telegram chain remains 2,516 items / 1,943,119 bytes, confirming the bounded-history change is still evidence-backed. No live data, deployment, Flux state, Telegram endpoint, or image was mutated.
bstein changed title from WIP: Harden Hermes chat continuity and activity rendering to Harden Hermes chat continuity and activity rendering 2026-08-18 04:04:06 +00:00
bstein scheduled this pull request to auto merge when all checks succeed 2026-08-18 04:04:50 +00:00
bstein added 37 commits 2026-08-18 09:56:12 +00:00
Decides whether the Hermes platform handoff is fit to release, and refuses
to round an absence of evidence up to a pass.

The harness is read-only by default and classifies 71 checks PASS / FAIL /
NOT_RUN / NOT_APPLICABLE. Any mandatory FAIL or NOT_RUN is NO_GO, and so is a
harness-level problem: an unreachable vantage, a catalog entry whose evidence
no longer exists, an expired deadline, or an evaluator that raised.

Evidence comes from two vantages that cannot cover for each other: an external
read-only operator kubeconfig, and the Hermes agent probing itself from inside
its own pod. Before any check runs, the harness asks each vantage who it is and
stops if they are the same principal, because dual-vantage evidence from one
identity is a restatement rather than a corroboration. `--as` is rejected for
every operator-side command and reachable only as the inner command of a
`kubectl exec`, so impersonation can never stand in for a real self-probe. A
deny check needs a live refused request, not only an authorization review.

Two safety properties are structural rather than conventional, enforced where
an argv becomes a subprocess: the default mode mutates nothing (mutating verbs
require a server dry run; there is deliberately no live TokenRequest probe,
because a successful one would mint a real credential), and no probe can pull a
credential value into a report (no vault/sops/curl, secrets readable only with
-o name, environment probes list names, shell only through frozen reviewed
templates). Captures are bounded before they are screened, and the rendered
report is re-screened before it is written.

Mutation lives behind a separate arming flag with an exact confirmation phrase,
a caller-supplied unique ref, a preflight that refuses a protected push target
before any network call, and a cleanup whose verification is itself mandatory.
A default run reports those four checks NOT_RUN.

The catalog is declarative so a reviewer reads what is asserted rather than how
it is plumbed, and so structural properties can be proven over every entry
before a run. Catalog drift surfaces as NOT_RUN, which stops the release.

docs/hermes_full_handoff_acceptance.md carries the merge order for PRs #14-#18
on top of the merged #13 baseline, the image build and Flux rollout, the
rollback point for each step, the go/no-go checklist, and the limits that are
asserted rather than exercised.

Validation: 295 handoff tests pass with 100% line coverage on all 15 new
modules; the full unit suite is 647 passed with two failures that reproduce
unchanged on origin/main; Ruff, py_compile, kustomize render, and a diff
credential screen are clean; a live read-only run against Atlas returns NO_GO
for the pre-merge cluster with no unscreened fields in the report.
The local goal judge scored every worker report against "did the reviewed
implementation reach a shippable state". A read-only reviewer that returned a
completed BLOCK verdict with findings was therefore resumed turn after turn with
an instruction to repair code it was forbidden to touch (observed live on
t_dbdcd739), burning subscription capacity and risking an unbounded loop.

Completion is now judged against the action the card assigned:

* Cards declare their role explicitly with Hermes-Task-Role / Hermes-Expected-
  Output metadata. Pre-contract cards fall back to a narrow inference that needs
  a read-only scope, a requested verdict, no requested mutation deliverable, and
  a report that changed no files.
* Role resolution reads only the card itself. Prior attempts, parent results,
  cross-task history and comments appended to the worker context can no longer
  reassign the role.
* Review, audit and diagnostic cards finalize deterministically on a truthful
  SHIP or BLOCK verdict with evidence, and fail closed on a missing,
  unrecognized or self-contradictory verdict, on a BLOCK without findings, and
  on a verdict without evidence. Every rejection reason carries the read-only
  guard, so a resumed review is never told to edit the reviewed implementation.
* Implementation cards keep the fail-closed model judge unchanged, including the
  unfinished-work heuristic and judge-unavailable rejection.
* All judge reasons are bounded, single-line and secret-redacted before they
  reach Kanban metadata, comments and continuation prompts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
evaluate_names_absent returned PASS when its step exited 0 with no output,
so five mandatory checks - the ones asserting that provider API keys, forge
credentials, a cluster-admin binding, and shared coordinator state are
absent - could report a pass on no evidence and turn a NO_GO into a GO.
Both name rules now resolve their step through one guard in _line_step, so
zero observations are NOT_RUN. Regressions pin all five real catalog specs
plus both reachable silence paths: a POSIX pipeline whose status comes from
its last stage, and a drifted kubectl -o jsonpath. The pool claim projection
emits one <volume>=<claim> line per template volume so a volume without a
PVC still counts as an observation rather than reading as drift.

Also closes the review's reachable hardening and evidence defects:

- pin Gitea paths to atlas/titan-iac on an exact segment boundary and
  reject relative segments, including percent-encoded ones
- forbid impersonation structurally in every mode and vantage; the inner
  command of kubectl exec is re-checked rather than exempted, and
  validate_catalog no longer guards only the operator vantage
- drop flux and helm from the binary allowlist; they had no pinned release
  digest, so no allowlisted binary can now be admitted that the executor
  would refuse to attest
- remove the inert --concurrency and --expect-telegram-sessions flags and
  the dead concurrency bound; Telegram continuity stays mandatory
- read the ephemeral pull index page by page, treat the create response as
  an authoritative source for the pull number, close every number either
  source names, and surface residue_ref plus exact manual_cleanup commands
  when creation is uncertain
- keep executable_path and executable_sha256 on unrecorded bulk-evidence
  steps so withholding bytes never withholds binary attestation
- revert the repo-wide hygiene legacy-exception mechanism; the contract
  change here is purely additive and the four pre-existing over-cap files
  are left to the canonical contract change in PR #14/#15
- correct the runbook ruff format scope so the documented command passes

Split hermes_handoff_arming.py out of hermes_handoff_ephemeral.py to keep
both modules under the 500-line cap. All 16 handoff modules hold at least
95% line and branch coverage; the mutation gate is 13/13.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Refresh #12 and #18 to their live Gitea heads, record #19's replaced head
exactly, and replace the pairwise conflict set with a freshly computed one
over all 28 combinations. #18+#19 is now clean because #19 no longer
duplicates the repo-wide hygiene legacy-exception mechanism that #18 also
carries; #12+#19 is new because #12 advanced. Name the exact overlapping
files per conflicting pair and how to resolve each additively.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The distributed worker pool stacks on exactly two open pull requests, in this
order: PR 14 supplies the broker-only SCM boundary the mediators route through
and the hermes-scm-boundary-v2 ConfigMap they mount, and PR 15 supplies the
cli_lane_* decomposition -- including canonical_run_id and the eligibility
predicate on claim_ready -- that the coordinator depends on. Neither can be
dropped without breaking a fixed P0 boundary, so both are carried here as
prerequisites and this branch must not merge before them.

PR 16 (agent image release lane) and PR 19 (full-handoff acceptance harness)
are NOT prerequisites and are deliberately absent, so reviewing this branch no
longer means approving them.

PR 14 and PR 15 conflict with each other in nine paths. Each is resolved to the
resolution already reviewed on this branch at 4d4cf1bd.
Three fenced worker Pods claim Hermes Kanban runs through a coordinator that
owns every state transition, with per-ordinal HMAC authority, a mediated
broker-only SCM path, and durable per-ordinal workspaces.

Content is the reviewed head of PR #18 (689bcb6e) with PR 16's and PR 19's
contributions removed: they were merged in only to validate co-existence and are
not prerequisites, so this branch no longer carries them as ancestors. Only PR 14
and PR 15 remain, because the broker boundary and the cli_lane_* decomposition
are load-bearing for two of the fixed P0 boundaries.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Independent review t_5975c06a blocked this branch on a P1: a Kanban write that
failed while a lease expired left a `lease_failed` row that was invisible to
every pass, immortal to garbage collection, and fatal to the coordinator. It
poisoned `reconcile()` forever with a conflicting-duplicate primary key,
produced a spurious capability `block_task` from `dispatch()`, and -- because
startup maintenance ran unguarded before the port bound, against a store on a
PVC -- crash-looped the coordinator with no automatic recovery.

`lease_failed` is now a retryable state that every maintenance pass drains, and
a row only reaches a terminal state on authoritative evidence about its exact
Kanban run, so nothing is collected before its outcome is known and nothing is
silently dropped. Each row, task, and board is processed in isolation, and a
coordinator-side fault is never converted into a Kanban mutation. Startup runs
through the same guarded cycle as the steady-state loop.

The wire protocol and the durable store are now separate modules, and the
maintenance passes moved out of the coordinator, so each file stays under the
managed line ceiling with room for the recovery logic.

Also closes three consequential handoff risks the same review raised:

* mediator-N pinned itself hard to worker-N while sharing a ReadWriteOnce
  claim, so a drain or preemption that moved only the lower-priority worker
  deadlocked the ordinal on Multi-Attach until an operator deleted a Pod. The
  shared workspace is now ReadWriteMany (as the hermes-chat tenant workspaces
  already are on the same class), colocation is a preference, and the mediator
  shares the worker's preemption priority, so each Pod reschedules on its own.
* the broker permits only branch creation, so a retry that added commits could
  never submit and the run's work was discarded with the failure. Submission
  now targets a fresh attempt- or content-scoped ref in the same reviewed
  namespace -- never an update -- and is idempotent under replay. A refused
  submission downgrades the result and says why instead of unwinding the run.
* the provider CLIs were reinstalled into an emptyDir on every Pod start inside
  the 10m Flux health window for the whole hermes app. They now install once
  per pinned version onto a durable volume, re-verified against the real
  binaries and time-bounded, and the best-effort pool no longer gates the
  health of the app its dependents wait on.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Document what an operator needs to know about the repairs: why the ordinal
workspace claim is ReadWriteMany and why colocation is only a preference, that
`lease_failed` is retryable rather than terminal and what a persistent deferred
park means, why a retry publishes an attempt-scoped ref and what to expect from
the extra drafts, and why the best-effort pool is deliberately absent from the
hermes Kustomization health checks.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Repairs the blockers from the independent review of the previous head. The
role-aware verdict contract was correct but reachable only through one call
site and only on cards written with real newlines, so most real review cards
never used it.

* The role-blind call is no longer a weaker classifier that can reject before
  the role-aware judge runs. Without a card there is no defensible
  role-dependent judgement, so `unfinished_result_reason()` applies only the
  card-independent checks. That closes the short-circuit at every call site,
  including the one PR15 moves to `cli_lane_execution`, and it makes a
  journalled terminal record accepted under one version of these semantics
  re-validate under any other instead of being quarantined into a re-dispatch
  of an already-accepted task.
* The lane resolves the role from the card and passes it, and records it in
  the Kanban metadata. The verdict contract binds only where the lane can buy
  another turn: in single-shot mode a rejection discards the worker's real
  result, so review cards keep the relaxation without gaining any rejection
  single-shot mode did not already have.
* Card scope expands the literal \n escapes the board stores in one-line
  bodies, so explicit `Hermes-Task-Role` / `Hermes-Expected-Output` directives
  are honoured on the 6 of 78 live cards that carry no real newline, and the
  read-only, verdict and mutation heuristics stop being cut apart by them.
* Card scope now ends at the first non-card H2 and at the runner's controller
  evidence, which is emitted under its own heading. Goal-controller rejection
  history can no longer sit inside the card, and an upstream heading rename
  fails closed instead of admitting history into role resolution.
* The inference recognises the SHIP/BLOCK-shaped deliverables real cards
  actually use: 21 of 78 live cards resolve to review, up from 10, with no
  implementation card misclassified. Cards asking for a findings list rather
  than a verdict deliberately stay on the model judge, since the verdict is
  the review contract's only gate.
* A declared review role no longer outranks mutation evidence: a report that
  changed files falls back to the implementation regime.
* Judge reasons go through the agent runtime's canonical redactor, extended
  for the two shapes it deliberately passes through and this lane handles -
  `scheme://user:secret@host` and a credential named in prose - while a 40-hex
  commit SHA survives as evidence.

Regressions cover the recovered t_dbdcd739 incident, a verbatim snapshot of
every live card on three boards with a hand-labelled expected role, the
upgrade and single-shot properties against the previous gate, the upstream
context-heading contract, and the end-to-end `execute_claim` shape that used
to burn every goal turn.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add kanban routing keys (provider_quota_min_remaining_percent: 15,
provider_capacity_cooldown_seconds: 300, provider_auth_cooldown_seconds:
3600), a lane-metrics port/Service on 9011 with service-annotation
scraping, monitoring ingress for the new port, and the lane's quota
metrics URL env. Based on PR #15 (fix/hermes-result-decomposition-
reliability); stacked because this work rides on the decomposed lane.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Based on PR #15 (fix/hermes-result-decomposition-reliability); stacked
on the decomposed cli_lane modules.

- cli_lane_quota: soft-exclude a provider from NEW cli-auto work below
  the remaining-quota threshold (both-below prefers more remaining;
  fetch failure fails open with a metric).
- cli_lane_health: lane now writes provider health (G7) with classified
  failure reasons splitting the capacity conflation (quota/auth/
  rate-limit/transport) and cooldown hysteresis; re-admission only on
  full cooldown expiry, passed quota reset, or fresh success (G4).
- cli_lane_routing: capacity-limited health now excludes a provider
  (G3); cooldown/reset-aware re-admission.
- cli_lane_failover: explicit cli-codex-*/cli-claude-* assignees fail
  closed as transient instead of switching providers (G5); fallback
  depth stays bounded at two hosted providers (G1) with effort
  preserved; Switchyard outages block transient, not capability (G9).
- cli_lane_metrics: route-decision/fallback counters, quota and
  soft-exclusion gauges, pod-local scrape server (G6).
- cli_lane_provider: worker env drops ANTHROPIC_API_KEY, CLAUDE_API_KEY,
  OPENAI_API_KEY, API_SERVER_KEY so no metered path exists (G10).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deterministic coverage for the quota-aware lane: threshold boundaries
(14.9/15/15.1), both-below preference, fetch-failure fail-open, cooldown
elapsed-vs-not hysteresis, quota-reset recovery (never for auth),
explicit fail-closed in both directions, bounded double-failure block,
failure-reason classification, metrics emission, and worker env key
stripping. Based on PR #15 (fix/hermes-result-decomposition-reliability).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CAPACITY_PATTERN (the gate that sets result.capacity_failure) lacked the
bare unauthorized/forbidden/401/403 signals that classify_capacity_failure
already recognizes, so an auth blip surfacing only as "403 Forbidden"
was blocked as capability instead of transient: no auto failover, no
health cooldown. Add 401|403|unauthorized|forbidden to the gate so it
matches the classifier; reason classification still distinguishes auth
from quota/rate-limit/transport.

Tests: an auto card failing with only "403 Forbidden" now fails over to
the other provider, records an auth cooldown (authenticated:false), and
classifies the fallback reason as auth in metrics; a manual card with the
same failure still fails closed as transient. Router-outage tests moved to
test_hermes_cli_router_outage.py to keep both files <500 LOC.

Based on PR #15 (fix/hermes-result-decomposition-reliability).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reconcile two independent test/gate reorganizations:
- Gate/semgrep/mailu: keep main's #16 dual-metric implementation.
- quality_contract.json: union #16 image-builder + #14 scm/node + #15 cli_lane.
- agent-deployment.yaml: keep #14 gitea removal + #16 image-build-token + #15 probe.
- Test splits: main's chat/coordinator/agent organization is authoritative;
  drop #15's redundant competing splits and #14's stale cli-lane duplicates;
  keep #15's cli-lane decomposition suite and port the execution-safety test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
# Conflicts:
#	services/hermes/networkpolicy.yaml
#	testing/quality_contract.json
#	testing/tests/test_hermes_agent_security.py
# Conflicts:
#	services/hermes/scripts/cli_lane_runner.py
# Conflicts:
#	scripts/tests/test_dashboards_render_atlas_drilldowns.py
#	scripts/tests/test_dashboards_render_jobs.py
#	services/hermes/scm-common/scripts/scm_broker.py
#	services/hermes/scripts/cli_lane_dispatch.py
#	services/hermes/scripts/cli_lane_execution.py
#	testing/quality_contract.json
#	testing/tests/test_hermes_agent_access.py
#	testing/tests/test_hermes_agent_security.py
#	testing/tests/test_hermes_chat_config.py
#	testing/tests/test_hermes_chat_images.py
#	testing/tests/test_hermes_chat_provider_auth.py
#	testing/tests/test_hermes_chat_quality.py
#	testing/tests/test_hermes_chat_support.py
#	testing/tests/test_hermes_chat_voice.py
#	testing/tests/test_hermes_cli_finalization_edges.py
#	testing/tests/test_hermes_cli_foundation_coverage.py
#	testing/tests/test_hermes_cli_lanes_configuration.py
#	testing/tests/test_hermes_cli_recovery_edges.py
#	testing/tests/test_hermes_cli_retention_edges.py
#	testing/tests/test_hermes_coordinator.py
#	testing/tests/test_hermes_coordinator_boards.py
#	testing/tests/test_hermes_coordinator_support.py
Post-merge fixes after rebasing the distributed worker pool onto the
review-goal-semantics train tip:

- Pool SCM submission tests target the train's relocated receive-pack
  scanner: FEATURE_REF_RE now lives in receive_pack_scan, bodies are
  built via the shared _receive_command helper (valid pack), and the
  update-rejection assertion matches the train's message.
- Take the train's canonical test_hermes_scm_broker,
  test_hermes_cli_dispatch_runtime and test_hermes_cli_execution_edges,
  which exercise the train's broker/dispatch/execution behavior.
- Runtime staging tests patch os.fchown alongside os.chown so the
  UID-10000 _write_secret path passes under a non-root gate runner
  (production ownership behavior unchanged).
- Split the jenkins build-evidence contracts out of
  test_hermes_runtime_access into test_hermes_runtime_evidence to keep
  both files under the 500-LOC hygiene ceiling after the merge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Conflicts:
#	ci/scripts/semgrep_report.py
#	testing/quality_contract.json
#	testing/quality_coverage.py
#	testing/tests/conftest.py
#	testing/tests/test_hermes_auto_router.py
#	testing/tests/test_quality_contract.py
#	testing/tests/test_quality_coverage_helpers.py
#	testing/tests/test_semgrep_report.py
# Conflicts:
#	services/hermes/agent-deployment.yaml
#	testing/tests/test_hermes_auto_router.py
Extend the chat router HTML-injection bridge so tenants see a clean
chat + conversation-history experience instead of the full agent
cockpit. hideChatAdministration now hides the rail buttons and panels
for logs, insights, memory, skills, workspaces, todos, tasks and
profiles (alongside the existing Kanban), and bridgeCSS hides the same
[data-panel] targets pre-JS to avoid a flash. Also hide the redundant
legacy settings model dropdown (#settingsModel) via bridgeCSS while
keeping the composer routing chip. Chat, history/sessions, new-chat,
composer and the model chip are untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The composer routing chip showed bare AUTO/FAST/BALANCED/DEEP/MAXIMUM.
Relabel it to Automatic/Fast/Balanced/Deep/Maximum and align the
auto-route model option labels to Automatic · Fast/Balanced/Deep/Maximum
so they match the panels.js profile-default mapping and read as a
recognizable model name. Manual model names (Claude · Opus, etc.) are
unchanged. Update the image-build guard and its quality test to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
atlas-reconciler manually merged commit 1c4ed3af93 into main 2026-08-18 21:28:01 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: titan/atlas-iac#21
No description provided.