Skip to content

Add optional repo intelligence module using GitHub CLI-backed history sync #138

@stackbilt-admin

Description

@stackbilt-admin

Problem

Charter currently focuses on local-first repo governance and deterministic codebase analysis:

  • ADF context loading
  • commit validation
  • drift checks
  • blast-radius analysis
  • surface extraction
  • audit/reporting workflows
  • MCP project context exposure

That gives agents and developers a strong view of the repo’s current local state.

However, Charter does not yet have a way to understand the repo’s development history:

  • issue lifecycle
  • PR lifecycle
  • review behavior
  • release cadence
  • maintainer response patterns
  • stale or recurring problem areas
  • decision archaeology from comments and linked PRs
  • contributor concentration / bus-factor signals

For agent workflows, this is a missing layer. Agents can see the repo’s files and governance rules, but not the historical context of how the project evolved.

Why this matters

GitHub issue and PR history is effectively a semi-structured institutional memory layer.

A repo’s history can answer questions like:

  • Is this repo actively maintained?
  • What areas repeatedly break?
  • Which contributors actually drive development?
  • Are issues being triaged, ignored, or churned?
  • How long do PRs take to review and merge?
  • Which architectural decisions were debated in issues/PRs?
  • Are releases regular or sporadic?
  • Is the project becoming healthier or more chaotic over time?
  • What risks should an AI agent know before making changes?

This would complement Charter’s existing local analysis commands:

  • charter validate
  • charter drift
  • charter blast
  • charter surface
  • charter audit
  • charter adf bundle
  • charter serve

The goal is not to make Charter dependent on GitHub, hosted services, or network access by default.

The goal is to provide an optional, explicitly invoked repo intelligence module that can generate local development-history artifacts for humans and AI agents.

Key design constraint

Charter’s core posture should remain:

  • local-first
  • deterministic where possible
  • no required network calls
  • no credentials stored by Charter
  • no product/service dependency for normal governance usage

Therefore, this feature should not embed GitHub auth or require Charter to manage tokens.

Proposed implementation direction

Use the user’s installed GitHub CLI (gh) as the MVP transport layer.

This preserves Charter’s local-first/auth-minimal posture:

  • Charter does not manage GitHub OAuth.
  • Charter does not store GitHub tokens.
  • Existing gh auth login handles credentials.
  • Public/private repo access follows the user’s existing GitHub CLI permissions.
  • Network calls only occur when the user explicitly invokes a repo-intel command.
  • Advanced GitHub endpoints can still be accessed through gh api --paginate.

Conceptually:

charter repo sync
  ↓
detect gh CLI
  ↓
verify gh auth/status when needed
  ↓
run gh api --paginate ...
  ↓
normalize GitHub responses
  ↓
write local .charter/repo-intel artifacts
  ↓
generate metrics, dossiers, and optional ADF modules

Metadata

Metadata

Assignees

No one assigned

    Labels

    v0.13Targeted for Charter v0.13

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions