Skip to content

Consolidate Ether graph reads, telemetry defaults, and CLI session binding #15

Done
6 of 6 issues completed

Description

@h45sh

Problem Statement

Ether contributors have to trace shared behavior across several interfaces. Four cases affect callers today: sealed graph diffs enter the write guard, omitted telemetry budgets vary by interface, CLI session binding spans several modules, and composite Entity Graph reads can mix committed revisions.

Solution

Consolidate ownership in the existing graph and CLI modules. Restore historical graph diffs after Forensic Sealing, honor the configured snapshot budget across interfaces, preserve CLI syntax while centralizing session selection, and read nodes and edges from one committed view.

User Stories

  1. As an investigator, I want to retrieve an action-scoped diff after Forensic Sealing, so that I can review recorded Findings.
  2. As an investigator, I want to retrieve a baseline-scoped sealed diff, so that I can compare recorded changes against a timestamp.
  3. As an auditor, I want sealed Finding statuses and counts to remain stable after TTL expiry, so that repeating a historical read yields the same result.
  4. As an auditor, I want a historical diff to leave the evidence untouched, so that reading it preserves the seal.
  5. As an investigator, I want a diff to succeed when sealing wins the race with reconciliation, so that I can still read the recorded state.
  6. As an investigator, I want open sessions to continue reconciling Temporal State Decay automatically, so that active diffs reflect current status.
  7. As an operator, I want a custom snapshot budget honored by SDK, CLI, and MCP, so that I can configure the default once.
  8. As a caller, I want explicit budgets to override configuration, so that I can tune a single request.
  9. As a CLI operator, I want both budget aliases to remain valid, so that existing scripts still work.
  10. As a CLI operator, I want conflicting session arguments to produce a usage error, so that I can correct the command.
  11. As a CLI operator, I want explicit, environment, pinned, and default session selection to retain their precedence, so that familiar commands select the expected session.
  12. As a CLI operator, I want invalid pins to fall through to the default, so that implicit selection still works.
  13. As a CLI operator, I want explicit-only commands to keep requiring a session ID, so that their target remains deliberate.
  14. As an SDK consumer, I want nodes and edges from the same committed view, so that a concurrent write cannot produce a mixed-revision graph.
  15. As an Entity Graph consumer, I want existing filtering and response fields preserved, so that my integrations can adopt the consistency fix directly.
  16. As a maintainer, I want each shared rule to have one owner, so that changes and tests stay local.

Implementation Decisions

  • Graph diff compilation keeps its response fields and filters. For sealed sessions, compute the status breakdown from recorded Findings and emit no new Temporal State Decay transitions. For open sessions, keep automatic reconciliation. If sealing causes a rejected reconciliation, confirm the cause before falling back to recorded state. Propagate unrelated permission failures and retain the GraphStore write guard.
  • The snapshot compiler resolves omitted budgets from the caller's settings instance. SDK, CLI, and MCP pass through omission and explicit values. CLI --budget takes precedence over --max-tokens when both appear, regardless of order. Preserve session selection and authorization.
  • Preserve each CLI command's accepted syntax and explicit session requirements. The parser declares accepted forms. Reuse positional and option conflict handling where both forms already exist, and let CliContext own implicit selection in the order explicit ID, environment, valid pin, default.
  • Add a GraphStore composite read that owns one committed database view. Migrate the SDK graph read first, then other composite readers in follow-up changes with compatibility coverage. Existing filters and output shapes remain intact. Edges can still refer to deliberately filtered nodes.

Testing Decisions

  • Exercise the highest existing entry point that exposes each guarantee and assert observable behavior. Use hermetic in-memory or temporary databases.
  • Extend graph telemetry tests for action and baseline filters, recorded status counts after TTL expiry, open-session decay, sealed-state immutability, and the sealing race. Use a controlled interleaving and verify unrelated permission failures propagate.
  • Exercise SDK, CLI, and MCP snapshots with a configured default other than 4000 and an explicit override. Cover both CLI aliases together in both orders.
  • Extend CLI symmetry tests for matching and conflicting IDs, environment and pin precedence, invalid pins, and missing IDs on explicit-only commands.
  • Reproduce the SDK graph race with a coordinated writer and reader. Assert that the response matches one committed revision and separately verify existing edge behavior when stale nodes are filtered.
  • Run the repository's lint, formatting, typing, Tier 0, and applicable regression tests.

Out of Scope

  • Changes to execution policy, authorization, tool adapters, or database schema.
  • New CLI session forms or implicit selection for commands that require an explicit ID.
  • An endpoint-complete filtered graph contract.
  • A broad GraphStore rewrite.

Further Notes

Start with sealed diffs because the failure blocks historical reads. Follow ADR 0020 for consistent Entity Graph reads and sealed diffs, ADR 0017 for configuration precedence, and ADR 0018 for CLI session binding and Forensic Sealing.

Sub-issues

Sub-issues

6 of 6 Issues completed
Loading 6 sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:graphpriority:P1ready-for-agenttype:epic

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions