Skip to content

Make command history user-facing while preserving internal trace #1671

Description

@codeforester

Goal

Make basectl history read as a history of user-invoked Base commands while preserving the internal execution trace for troubleshooting.

Background

The current history writer records every Python implementation process launched by a Bash command. A single user action such as basectl setup banyanlabs can therefore produce setup, bootstrap, route, and projects rows. basectl test and basectl build can show internal trust or projects rows without a corresponding test or build row. The result is technically accurate but confusing as a UX surface. The project-attribution fixes in #1668, #1669, and #1670 make the remaining event-boundary problem more visible.

Scope

  • Define a history event boundary for primary user commands versus internal delegated steps.
  • Record one primary history entry for each public basectl command that executes work.
  • Mark delegated resolver, routing, bootstrap, and trust-gate records as internal child events with parent linkage where practical.
  • Hide internal events from default basectl history output while retaining them in the local history data and logs.
  • Add an explicit trace/include-internal view for diagnostics and JSON consumers.
  • Cover setup, check, doctor, test, trust, and build flows, including failed trust/build paths.
  • Update command help and documentation for the new history behavior.

Acceptance Criteria

  • Default history for a setup/check/doctor/test/trust/build sequence shows the user commands rather than helper commands such as projects, route, and bootstrap.
  • Directly invoked public commands such as basectl projects and basectl trust allow remain visible as primary events.
  • Internal events remain available through an explicit trace/include-internal option and in JSON output when requested.
  • A failed internal step is attributed to its primary parent command without losing the child log path or exit status.
  • Existing project, manifest, status, exit-code, redaction, and log-path fields remain correct.
  • Existing history records remain readable; the change is forward-compatible with older records that lack event-scope metadata.

Validation

  • Focused Python tests for base_cli.history, base_history, and affected Bash command suites.
  • Regression tests for setup, check, doctor, test, trust, and build history output.
  • git diff --check, focused pylint, and the full ./bin/base-test suite.
  • Hosted CI checks for the resulting pull request.

Non-Goals

  • Do not delete or rewrite existing history records.
  • Do not remove per-step log files or reduce diagnostic detail in logs.
  • Do not change command execution, trust policy, project resolution, or setup semantics.
  • Do not add a separate persistent tracing service or remote telemetry.

Project Fields

  • Priority: P2
  • Size: M
  • Area: CLI
  • Initiative: Contract Hardening
  • Milestone: v1.8.0

Agent Assignment

Human first; implementation is approved for the current Codex session after issue and Project intake are complete.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or product improvement

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions