Skip to content

feat(pr-management-triage): add session-history gist persistence (Step 6b) - #343

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:pr-management-triage/session-history-gist
May 27, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:pr-management-triage/session-history-gist

Conversation

@potiuk

@potiuk potiuk commented May 27, 2026

Copy link
Copy Markdown
Member

Summary

Adds an optional Step 6b at session end that proposes appending each triage session's stats to a long-lived private GitHub gist on the maintainer's account. The gist URL persists in a gitignored adopter-repo file (.apache-steward.session-state.json) so subsequent runs update the same gist rather than creating a new one each time.

The signal motivating this: a single triage session shows what happened this morning, but only a multi-session history reveals which rules consistently fire with no override and which heuristics need recalibration. That second view is the input for promoting "human-confirmed" actions to "automated" in future framework revisions.

What's added

  • SKILL.md — new Step 6b after the on-screen summary. Soft-fails to a one-line notice when the gh token lacks gist scope, or when no-history / dry-run is active.
  • session-history.md — new reference file documenting:
    • local state-file location and JSON schema (.apache-steward.session-state.json at adopter repo root, gitignored)
    • gist content schema (action counts, pre-filter breakdown, decision-rule signal table, per-PR override notes, deferrals)
    • create-vs-update logic
    • maintainer-confirmation flow (Y/N/E with full preview)
    • failure modes (deleted gist, public gist, malformed state JSON, concurrent worktrees)
    • privacy contract (no comment bodies, no diffs, no emails, no credentials)
  • prerequisites.md — non-blocking gist scope check with the exact gh auth refresh -s gist remediation command.
  • projects/_template/pr-management-config.md — new session_history_gist workflow choice (default enabled).
  • no-history selector in SKILL.md parameters.

Privacy

The gist is secret-by-default; the skill refuses to write to a gist that resolves as public via gh api gists/<id> --jq .public. The schema records action verbs and the maintainer's own override reasons — never PR comment bodies, diff snippets, author emails, or credential material.

Origin

Came out of a real triage session on apache/airflow (2026-05-27) where the maintainer (@potiuk) asked for cross-session calibration history. The original session's gist is the prototype the schema in session-history.md was distilled from.

Test plan

  • First-run path: delete .apache-steward.session-state.json, run a triage session, confirm gist creation prompt shows correct preview, confirm state file written after gist creation
  • Steady-state path: re-run with state file in place, confirm prepend preview shows only the new session block
  • Soft-fail path: gh auth refresh to drop gist scope, run skill, confirm Step 6b skips with the documented one-line notice
  • Public-gist refusal: manually flip the test gist to public, re-run, confirm skill refuses with the documented notice
  • no-history flag: confirm Step 6b is unconditionally skipped

🤖 Generated with Claude Code (Opus 4.7)

…p 6b)

Add an optional Step 6b at session end that proposes appending the
session's action counts, override notes, and pre-filter breakdown to a
long-lived **private** GitHub gist on the maintainer's account. The
gist URL persists in a gitignored adopter-repo file
(`.apache-steward.session-state.json`) so subsequent runs of the skill
update the same gist instead of creating a new one each time.

Why this exists. A single session shows what happened this morning;
a multi-session history shows which rules consistently fire with no
override and which heuristics need recalibration. That second view
is the input signal for promoting "human-confirmed" actions to
"automated" in future framework revisions.

What is added
- `SKILL.md` — new Step 6b after the on-screen summary, soft-fails
  to a one-line notice when the `gh` token lacks `gist` scope or
  when `no-history` / `dry-run` is active.
- `session-history.md` — content schema, create-vs-update logic,
  local state-file location, maintainer-confirmation flow, failure
  modes, privacy guarantees, and what the file is NOT.
- `prerequisites.md` — non-blocking `gist` scope check with the
  exact `gh auth refresh -s gist` remediation command.
- `projects/_template/pr-management-config.md` — new
  `session_history_gist` workflow choice (default `enabled`).
- New `no-history` selector documented in SKILL.md parameters.

Privacy. The gist is secret-by-default; the skill refuses to write
to a gist that resolves as public. The schema records action verbs
and override reasons typed by the maintainer — never PR comment
bodies, diffs, author emails, or credential material.
@potiuk
potiuk merged commit ceeeb0b into apache:main May 27, 2026
15 checks passed
potiuk added a commit to potiuk/airflow that referenced this pull request May 27, 2026
Adds the per-machine session-state file to .gitignore. The file is
written by steward skills that maintain adopter-local persistence
anchors — currently pr-management-triage Step 6b's session-history
gist URL (apache/magpie#343), but the structure is
deliberately shared so other skills can add their own keys later.

The file is per-user, per-machine state; it should never be
committed even when a contributor stages everything with `git add -A`.
potiuk added a commit to apache/airflow that referenced this pull request May 28, 2026
* Update apache-steward snapshot to 5c211a4

Bumps the local apache-steward snapshot from 339d3eb to 5c211a4 (22
upstream commits). The only committed change in this PR is a
1-line frontmatter addition (capability: capability:setup) to
.github/skills/setup-steward/SKILL.md, propagated from the new
framework version via /setup-steward upgrade. Everything else
lives in the gitignored .apache-steward/ snapshot.

Highlights from upstream (apache/airflow-steward):

- pr-management-triage: session-history gist persistence Step 6b
  (apache/magpie#343), four classifier heuristic fixes
  (apache/magpie#344), fetch-all-upfront pattern
  (apache/magpie#346)
- security-issue-triage: fetch-all-upfront analogue
  (apache/magpie#347)
- Framework labels + capability taxonomy (apache/magpie#340) —
  the source of the frontmatter line in this PR
- New skill pairing-self-review and tool spec-status-index
- claude-code pin 2.1.141 -> 2.1.150

/setup-steward upgrade ran cleanly locally: snapshot refreshed,
symlinks resolve, post-checkout hook in sync,
sandbox-add-project-root reconciled across 3 worktrees.
.apache-steward.local.lock updated to fetched_commit 5c211a4.
All .apache-steward-overrides/ files unchanged.

* Gitignore .apache-steward.session-state.json

Adds the per-machine session-state file to .gitignore. The file is
written by steward skills that maintain adopter-local persistence
anchors — currently pr-management-triage Step 6b's session-history
gist URL (apache/magpie#343), but the structure is
deliberately shared so other skills can add their own keys later.

The file is per-user, per-machine state; it should never be
committed even when a contributor stages everything with `git add -A`.
choo121600 pushed a commit to apache/airflow that referenced this pull request May 29, 2026
* Update apache-steward snapshot to 5c211a4

Bumps the local apache-steward snapshot from 339d3eb to 5c211a4 (22
upstream commits). The only committed change in this PR is a
1-line frontmatter addition (capability: capability:setup) to
.github/skills/setup-steward/SKILL.md, propagated from the new
framework version via /setup-steward upgrade. Everything else
lives in the gitignored .apache-steward/ snapshot.

Highlights from upstream (apache/airflow-steward):

- pr-management-triage: session-history gist persistence Step 6b
  (apache/magpie#343), four classifier heuristic fixes
  (apache/magpie#344), fetch-all-upfront pattern
  (apache/magpie#346)
- security-issue-triage: fetch-all-upfront analogue
  (apache/magpie#347)
- Framework labels + capability taxonomy (apache/magpie#340) —
  the source of the frontmatter line in this PR
- New skill pairing-self-review and tool spec-status-index
- claude-code pin 2.1.141 -> 2.1.150

/setup-steward upgrade ran cleanly locally: snapshot refreshed,
symlinks resolve, post-checkout hook in sync,
sandbox-add-project-root reconciled across 3 worktrees.
.apache-steward.local.lock updated to fetched_commit 5c211a4.
All .apache-steward-overrides/ files unchanged.

* Gitignore .apache-steward.session-state.json

Adds the per-machine session-state file to .gitignore. The file is
written by steward skills that maintain adopter-local persistence
anchors — currently pr-management-triage Step 6b's session-history
gist URL (apache/magpie#343), but the structure is
deliberately shared so other skills can add their own keys later.

The file is per-user, per-machine state; it should never be
committed even when a contributor stages everything with `git add -A`.
(cherry picked from commit c521078)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
vatsrahul1001 pushed a commit to apache/airflow that referenced this pull request May 29, 2026
* Update apache-steward snapshot to 5c211a4

Bumps the local apache-steward snapshot from 339d3eb to 5c211a4 (22
upstream commits). The only committed change in this PR is a
1-line frontmatter addition (capability: capability:setup) to
.github/skills/setup-steward/SKILL.md, propagated from the new
framework version via /setup-steward upgrade. Everything else
lives in the gitignored .apache-steward/ snapshot.

Highlights from upstream (apache/airflow-steward):

- pr-management-triage: session-history gist persistence Step 6b
  (apache/magpie#343), four classifier heuristic fixes
  (apache/magpie#344), fetch-all-upfront pattern
  (apache/magpie#346)
- security-issue-triage: fetch-all-upfront analogue
  (apache/magpie#347)
- Framework labels + capability taxonomy (apache/magpie#340) —
  the source of the frontmatter line in this PR
- New skill pairing-self-review and tool spec-status-index
- claude-code pin 2.1.141 -> 2.1.150

/setup-steward upgrade ran cleanly locally: snapshot refreshed,
symlinks resolve, post-checkout hook in sync,
sandbox-add-project-root reconciled across 3 worktrees.
.apache-steward.local.lock updated to fetched_commit 5c211a4.
All .apache-steward-overrides/ files unchanged.

* Gitignore .apache-steward.session-state.json

Adds the per-machine session-state file to .gitignore. The file is
written by steward skills that maintain adopter-local persistence
anchors — currently pr-management-triage Step 6b's session-history
gist URL (apache/magpie#343), but the structure is
deliberately shared so other skills can add their own keys later.

The file is per-user, per-machine state; it should never be
committed even when a contributor stages everything with `git add -A`.
(cherry picked from commit c521078)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Sep 14, 2026
* Update apache-steward snapshot to 5c211a4

Bumps the local apache-steward snapshot from 339d3eb to 5c211a4 (22
upstream commits). The only committed change in this PR is a
1-line frontmatter addition (capability: capability:setup) to
.github/skills/setup-steward/SKILL.md, propagated from the new
framework version via /setup-steward upgrade. Everything else
lives in the gitignored .apache-steward/ snapshot.

Highlights from upstream (apache/airflow-steward):

- pr-management-triage: session-history gist persistence Step 6b
  (apache/magpie#343), four classifier heuristic fixes
  (apache/magpie#344), fetch-all-upfront pattern
  (apache/magpie#346)
- security-issue-triage: fetch-all-upfront analogue
  (apache/magpie#347)
- Framework labels + capability taxonomy (apache/magpie#340) —
  the source of the frontmatter line in this PR
- New skill pairing-self-review and tool spec-status-index
- claude-code pin 2.1.141 -> 2.1.150

/setup-steward upgrade ran cleanly locally: snapshot refreshed,
symlinks resolve, post-checkout hook in sync,
sandbox-add-project-root reconciled across 3 worktrees.
.apache-steward.local.lock updated to fetched_commit 5c211a4.
All .apache-steward-overrides/ files unchanged.

* Gitignore .apache-steward.session-state.json

Adds the per-machine session-state file to .gitignore. The file is
written by steward skills that maintain adopter-local persistence
anchors — currently pr-management-triage Step 6b's session-history
gist URL (apache/magpie#343), but the structure is
deliberately shared so other skills can add their own keys later.

The file is per-user, per-machine state; it should never be
committed even when a contributor stages everything with `git add -A`.

GitOrigin-RevId: c52107833248f524803b996222fcb7bb51d8a0fa
@potiuk potiuk added capability:triage Sweep + classify + propose disposition family:pr-management pr-management-* skills family:setup setup-* skills labels Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:triage Sweep + classify + propose disposition family:pr-management pr-management-* skills family:setup setup-* skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant