Skip to content

feat(hermit): add approval-gated knowledge maintenance to weekly review #672

Description

@gtapps

Problem

The weekly review already owns knowledge health, topic-page checks, raw retention, and compiled rotation. It does not distinguish deterministic housekeeping from semantic curation: moving a source to raw/, merging/replacing a topic, or archiving a meaningful current design requires judgment that usage telemetry cannot safely provide.

The recent cleanup reduced the live working set to six topic pages, one raw source, and an archive of dated work. We need a repeatable maintenance contract that preserves this shape without creating a second scheduler or blindly treating inactivity as irrelevance.

Proposed design

Extend the existing weekly-review routine with a two-phase knowledge-maintenance flow. Do not add a new routine.

Phase 1: deterministic, automatic, quiet when clean

  • Run knowledge-lint.
  • Archive expired raw/ inputs using the existing retention policy.
  • Keep the existing metadata-based compiled rotation for clearly superseded artifacts.
  • Check the compiled working-set threshold, oversized artifacts without an injection_stub, stale topic pages, undeclared types, and schema drift.
  • If clean, emit no model-facing maintenance task or operator notice.

Phase 2: semantic reconciliation, approval-gated

When Phase 1 finds actionable knowledge drift, prepare a concise proposed maintenance set that can include:

  • source capture move to raw/;
  • compacting or merging a living topic-* page;
  • archiving a dated assessment, design, audit, spike, plan, or review;
  • retaining a current document with a short rationale.

Present the set to the operator and apply it only after explicit approval. Usage silence is never enough evidence for a semantic archive decision: startup injection and subagent reads are not represented in usage metrics.

Boundaries

  • weekly-review remains the sole scheduled owner; do not introduce another scheduler or monitor.
  • Never automatically reclassify a compiled conclusion as raw evidence.
  • Never automatically rewrite/merge topic pages.
  • Never automatically archive the sole current design or assessment for a subject.
  • Never automatically add foundational.
  • Preserve recoverability: archival remains a move to compiled/.archive/ or raw/.archive/, never deletion.
  • Keep deterministic prechecks filesystem-only; invoke model judgment only on a non-clean result.

Acceptance criteria

  • A clean weekly run completes with no knowledge-maintenance model turn or operator notice.
  • A threshold/lint failure produces one compact, actionable proposal instead of mutating knowledge.
  • Approval applies exactly the proposed moves/updates; rejection leaves artifacts untouched.
  • Raw retention and metadata-only compiled rotation continue to work as today.
  • Tests cover clean, proposed, approved, rejected, malformed metadata, and missing usage-ledger cases.
  • Documentation explains the automatic-versus-approval-gated boundary.

Context

The current weekly-review already runs knowledge lint, topic-page evaluation, raw archival, and compiled archival. This issue narrows the semantic decision boundary rather than expanding the always-on surface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions