Skip to content

feat(selfhost): scheduled + on-demand refresh for repo-doc generation #3003

Description

@JSONbored

Context

Part of the repo-specific CLAUDE.md/AGENT.md generation roadmap. Once generation exists and is config-gated, it needs a way to actually run periodically, and a way for an operator to trigger it on demand, so repos stay current without a maintainer remembering to invoke it manually. The self-host stack already has scheduled-job infrastructure (src/selfhost patterns used elsewhere for maintenance and admission work); this issue reuses that rather than introducing a second scheduler.

Goal

Add a scheduled job (default weekly, operator-configurable interval) plus a manual/on-demand trigger that re-run generation and open a fresh PR only when the proposed content meaningfully changed.

Requirements

  • Reuse the self-host stack's existing scheduled-job/cron pattern rather than a bespoke timer.
  • Interval is operator-configurable per repo (or globally with a per-repo override), consistent with how other self-host scheduled behaviors are configured.
  • Manual/on-demand trigger exposed via CLI and/or an MCP tool, matching how other maintainer-facing operations in this engine are already exposed.
  • Before opening a new PR, diff the freshly generated content against the current state of the target file(s) and skip opening a PR when there is no meaningful change -- avoid PR spam on a stable repo.
  • Refresh runs respect the same config-as-code enable/scope/exclusion surface as the on-demand path -- no separate code path with different eligibility rules.

Deliverables

  • Scheduled job registered on the self-host stack's existing job infrastructure, default weekly, operator-configurable
  • CLI and/or MCP manual-trigger entry point
  • No-meaningful-change short-circuit that skips PR creation, with test coverage for both the changed and unchanged cases
  • Config wiring shared with the .gittensory.yml enable/scope surface

Expected outcomes

  • A repo with generation enabled receives an updated PR only when the underlying codebase has drifted enough to change the generated content
  • An operator can force an immediate refresh for a single repo without waiting for the scheduled interval

Part of the repo-doc generation roadmap: #2993

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions