Skip to content

Make Counter consume canonical Analysis state #112

Description

@fproulx-boostsecurity

Outcome

Make Counter a revision-aware consumer of Kitchen's canonical Analysis state, remove all local Analysis graph reconstruction, and close the modernization iteration with operator-flow verification.

Depends on

Scope

  • Fetch and apply a Pantry snapshot only after successful reconciliation, checking that its revision is at least the run's committed revision.
  • Retry a temporarily stale snapshot with a bounded short policy; reject older snapshots and keep the last committed Counter Pantry.
  • Treat an empty canonical snapshot as valid state.
  • On reconciliation failure, keep the last committed Pantry and show a non-blocking operator notice with the safe failure and explicit rerun action.
  • When a successful refresh removes the focused tree item, move focus to the nearest surviving ancestor and announce that confirmed-gone items were removed.
  • Preserve newly obtained but unpersisted credentials in Counter memory and render them distinctly from persisted Loot.
  • Keep progress, metadata-sync updates, and late messages correlated to their run/session.
  • Remove local Analysis pruning, import, identity synthesis, and duplicate self-hosted-runner synchronization from Counter.

Deletion and test relocation

  1. Replace completion tests that assert local import mechanics with run-outcome and revisioned-snapshot state-transition tests.
  2. Delete the local importer/helper clusters in internal/counter/tui/analysis.go and model.go.
  3. Delete local same-Repository prune and dedup paths and their implementation-coupled tests.
  4. Delete any remaining legacy request, response, status, observer, importer, or schema compatibility symbols found by a final repository search.
  5. Keep behavior tests for findings, tree state, credential visibility, focus recovery, and operator notices at the canonical model interfaces.

Verification

  • Successful reconciliation refreshes to the required revision, including an empty graph.
  • Temporarily stale and permanently stale snapshot responses follow the bounded retry and keep-last-state rules.
  • Reconciliation failure never mutates Counter's committed graph.
  • Confirmed-gone refresh removes tree items, moves focus safely, and explains the update without confirmation.
  • Persisted Loot remains visible when source structure disappears.
  • Newly obtained Loot remains visible and visibly unpersisted after an atomic Loot persistence failure.
  • Late progress or completion from an older run cannot overwrite the active run.
  • There is no Counter Analysis graph importer or local Analysis History writer left.

Run at minimum:

go test ./internal/counter/tui ./internal/counter ./internal/kitchen/db ./internal/kitchen
go test -race ./internal/pantry ./internal/kitchen ./internal/counter/tui
make test
make lint
make e2e-smoke

Run make e2e-goat when the environment needed for the full Whooli chain is available; otherwise record why it was not run.

Done when

Counter renders Kitchen's committed Analysis state and outcomes without reconstructing canonical graph state, and the final dead-code search finds none of the superseded paths.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureArchitecture and structural codebase improvementready-for-agentFully specified and ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions