Skip to content

feat(context-refresh): add repo-intel source for GitHub history snapshots#182

Merged
stackbilt-admin merged 1 commit into
mainfrom
feat/squad3b-repo-intel
May 23, 2026
Merged

feat(context-refresh): add repo-intel source for GitHub history snapshots#182
stackbilt-admin merged 1 commit into
mainfrom
feat/squad3b-repo-intel

Conversation

@stackbilt-admin
Copy link
Copy Markdown
Member

Summary

Closes #138.

Adds repo-intel as a new source for charter context-refresh --sources repo-intel. Uses the gh CLI to fetch open/closed issues, recent PRs, and release history, then writes a structured snapshot to .charter/repo-intel/snapshot.json and contributes a summary to .ai/context.adf.

Snapshot shape:

{
  "available": true,
  "summary": {
    "openIssueCount": 12,
    "stalledIssues": 3,
    "recurringLabels": ["bug"],
    "mergeVelocity": 7,
    "releaseCadence": 14
  }
}

Graceful degradation: if gh is unavailable or the repo has no GitHub remote, emits a warning and continues — never a hard failure.

Test plan

  • Happy path: snapshot written with correct summary fields
  • ADF output includes repo-intel section and sourcesUsed
  • gh unavailable → warning emitted, no error, snapshot not written
  • 5/5 existing context-refresh tests pass (no regressions)
  • 3/3 new repo-intel tests pass
  • TypeScript clean

🤖 Generated with Claude Code

…hots (#138)

New --sources repo-intel pulls open/closed issues, PRs, and release cadence
via gh CLI and writes .charter/repo-intel/snapshot.json. Computes a summary
(openIssueCount, stalledIssues, recurringLabels, mergeVelocity, releaseCadence)
contributed to context.adf openWork/recentActivity sections. Fails gracefully
when gh is unavailable or repo has no GitHub remote — emits a warning, not
an error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@stackbilt-admin
Copy link
Copy Markdown
Member Author

Review pass complete for #182.

No blocking issues found in the current diff.

What I validated:

  • repo-intel source degrades gracefully when gh is unavailable.
  • Source inclusion in sourcesUsed and derived aggregates is wired coherently.
  • Full repo-intel snapshot persistence and tests are present and aligned with behavior.

Non-blocking follow-up suggestion:

  • Consider whether .charter/repo-intel/snapshot.json should respect custom --config paths, or remain intentionally fixed at .charter and be documented as such.

I’m comfortable merging this as-is.

@stackbilt-admin stackbilt-admin merged commit c5cf79b into main May 23, 2026
5 checks passed
@stackbilt-admin stackbilt-admin deleted the feat/squad3b-repo-intel branch May 23, 2026 12:21
stackbilt-admin added a commit that referenced this pull request May 23, 2026
…hots (#138) (#182)

New --sources repo-intel pulls open/closed issues, PRs, and release cadence
via gh CLI and writes .charter/repo-intel/snapshot.json. Computes a summary
(openIssueCount, stalledIssues, recurringLabels, mergeVelocity, releaseCadence)
contributed to context.adf openWork/recentActivity sections. Fails gracefully
when gh is unavailable or repo has no GitHub remote — emits a warning, not
an error.

Co-authored-by: Kurt Overmier <kurt@stackbilt.dev>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
stackbilt-admin added a commit that referenced this pull request May 23, 2026
)

* feat(bootstrap): add --mode lean for fast, install-safe project onboarding (#139)

Skips migrate, install, and populate phases. Install failure can no longer
produce a `partial` status — lean mode emits a deterministic install command
as the first required next step instead. Fully compatible with --yes, --ci,
--force, and --security-sensitive.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(drift): scan template literal bodies for anti-patterns (#102) (#181)

Extracts backtick template strings from .ts/.tsx/.js/.mjs files and scans
their bodies against drift patterns, attributing violations to virtual
filenames (e.g. src/foo.ts[template:0]). Catches security anti-patterns
inside code-factory functions that emit string templates. No signature
changes to scanForDrift.

Co-authored-by: Kurt Overmier <kurt@stackbilt.dev>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(context-refresh): add repo-intel source for GitHub history snapshots (#138) (#182)

New --sources repo-intel pulls open/closed issues, PRs, and release cadence
via gh CLI and writes .charter/repo-intel/snapshot.json. Computes a summary
(openIssueCount, stalledIssues, recurringLabels, mergeVelocity, releaseCadence)
contributed to context.adf openWork/recentActivity sections. Fails gracefully
when gh is unavailable or repo has no GitHub remote — emits a warning, not
an error.

Co-authored-by: Kurt Overmier <kurt@stackbilt.dev>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(bootstrap): gate lean-mode hook next-steps on inGitRepo

Hooks cannot be installed outside a git repo. The non-lean path already
gated these steps on inGitRepo; lean mode was missing the same guard.
Tests updated to mock isGitRepo via git-helpers module mock (runGit uses
execFileSync, not execSync, so the existing execSync override couldn't
cover it).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Kurt Overmier <kurt@stackbilt.dev>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
stackbilt-admin added a commit that referenced this pull request May 23, 2026
…li (#127) (#183)

* feat(bootstrap): add --mode lean for fast, install-safe project onboarding (#139)

Skips migrate, install, and populate phases. Install failure can no longer
produce a `partial` status — lean mode emits a deterministic install command
as the first required next step instead. Fully compatible with --yes, --ci,
--force, and --security-sensitive.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(drift): scan template literal bodies for anti-patterns (#102) (#181)

Extracts backtick template strings from .ts/.tsx/.js/.mjs files and scans
their bodies against drift patterns, attributing violations to virtual
filenames (e.g. src/foo.ts[template:0]). Catches security anti-patterns
inside code-factory functions that emit string templates. No signature
changes to scanForDrift.

Co-authored-by: Kurt Overmier <kurt@stackbilt.dev>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(context-refresh): add repo-intel source for GitHub history snapshots (#138) (#182)

New --sources repo-intel pulls open/closed issues, PRs, and release cadence
via gh CLI and writes .charter/repo-intel/snapshot.json. Computes a summary
(openIssueCount, stalledIssues, recurringLabels, mergeVelocity, releaseCadence)
contributed to context.adf openWork/recentActivity sections. Fails gracefully
when gh is unavailable or repo has no GitHub remote — emits a warning, not
an error.

Co-authored-by: Kurt Overmier <kurt@stackbilt.dev>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(bootstrap): gate lean-mode hook next-steps on inGitRepo

Hooks cannot be installed outside a git repo. The non-lean path already
gated these steps on inGitRepo; lean mode was missing the same guard.
Tests updated to mock isGitRepo via git-helpers module mock (runGit uses
execFileSync, not execSync, so the existing execSync override couldn't
cover it).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(cli)!: remove commercial surface from @stackbilt/cli at Charter 1.0 (#127)

Phase 4 of RFC #112. Deletes run/architect/scaffold/login commands,
credentials.ts, http-client.ts, scaffold-contract-types.ts, and all
related tests. Drops the `stackbilt` bin alias. Bumps @stackbilt/cli
to 1.0.0. @stackbilt/build@0.1.0 is the new home for these commands.

BREAKING CHANGE: run, architect, scaffold, login commands and stackbilt
bin removed. Install @stackbilt/build for the long-term home.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(cli): add repo-intel to context-refresh help; ignore package-lock.json

- HELP text for `context-refresh --sources` was missing the third valid
  value `repo-intel` (added in the repo-intel source commit on this branch)
- Add `package-lock.json` to .gitignore — repo uses pnpm; the npm lockfile
  has no business being tracked here

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Kurt Overmier <kurt@stackbilt.dev>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant