Skip to content

Commit d89837e

Browse files
author
minion[bot]
committed
chore: add minion proposals
1 parent d4ebe59 commit d89837e

File tree

4 files changed

+112
-1
lines changed

4 files changed

+112
-1
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
id: fix-multiple-commits-per-turn-missing-trailer
3+
target_repos:
4+
- cli
5+
pr_labels:
6+
- minion
7+
acceptance_criteria:
8+
- "All commits made within the same agent session turn receive the `Partio-Checkpoint` trailer"
9+
- "The pre-commit hook correctly detects and saves state for each commit, not just the first"
10+
- "A regression test covers the case of two sequential commits within the same active session"
11+
- "The fix does not affect the hook re-entry prevention logic for `git commit --amend`"
12+
---
13+
14+
# Fix: subsequent commits within the same agent turn don't get checkpoint trailers
15+
16+
## Description
17+
18+
When using the `manual-commit` strategy, only the first commit in an agent session turn gets the `Partio-Checkpoint` trailer. Subsequent commits within the same active session are silently skipped, causing their changes to be orphaned from the session transcript.
19+
20+
**Root cause (analogous to entireio/cli#784):** The pre-commit hook saves detection state to `.partio/state/pre-commit.json`. The post-commit hook reads and immediately deletes this file before creating the checkpoint. For the *second* commit in the same turn, if the session state or detection logic produces a result that is filtered out (e.g., the session appears to have no *new* content since the previous checkpoint was already written), the linking is silently skipped.
21+
22+
**Fix:** Ensure the session new-content detection in `internal/hooks/post_commit.go` accounts for content added between checkpoints within the same turn, not just between the previous checkpoint and the start of the turn. The detection cursor should advance after each commit's checkpoint is written.
23+
24+
## Context Hints
25+
26+
- `internal/hooks/` — pre-commit and post-commit hook implementations
27+
- `internal/session/` — session state tracking
28+
- `internal/agent/claude/` — JSONL parsing and new-content detection
29+
30+
<!-- program: .minions/programs/fix-multiple-commits-per-turn-missing-trailer.md -->
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
id: partio-attach-manual-session-link
3+
target_repos:
4+
- cli
5+
pr_labels:
6+
- minion
7+
acceptance_criteria:
8+
- "`partio attach <session-id>` links a previously untracked session to the most recent commit"
9+
- "`partio attach <session-id> <commit-hash>` links the session to the specified commit"
10+
- "Command validates that the session ID exists in the local sessions directory"
11+
- "Command creates a checkpoint on the orphan branch linking session to commit"
12+
- "Command fails gracefully with a helpful error if the session or commit is not found"
13+
- "Command is idempotent: re-attaching an already-linked session updates rather than duplicates"
14+
---
15+
16+
# Add `partio attach` command to manually link untracked sessions to commits
17+
18+
## Description
19+
20+
When Claude Code sessions are started outside the normal pre-commit hook flow — for example, when Partio wasn't enabled at session start, when the agent was launched from a parent directory before the repo was initialized, or when a session ran without triggering the pre-commit hook — users have no way to retroactively link those sessions to their commits.
21+
22+
Add a `partio attach` command that accepts a session ID and optional commit hash, then creates a checkpoint on the `partio/checkpoints/v1` branch linking the session to that commit.
23+
24+
```
25+
partio attach <session-id> # link to HEAD
26+
partio attach <session-id> <commit-hash> # link to specific commit
27+
```
28+
29+
The command should:
30+
1. Validate the session ID exists in the local Claude sessions directory (via `internal/agent/claude`)
31+
2. Parse the session's JSONL transcript to extract metadata (prompt, context, files)
32+
3. Calculate attribution from the session data
33+
4. Write a checkpoint using the existing git plumbing machinery in `internal/checkpoint`
34+
5. Amend the target commit with the `Partio-Checkpoint: <id>` trailer (or print instructions if amending HEAD is not desirable)
35+
36+
## Context Hints
37+
38+
- `cmd/partio/` — add new `attach` command
39+
- `internal/checkpoint/` — checkpoint creation logic
40+
- `internal/agent/claude/` — session discovery and JSONL parsing
41+
- `internal/session/` — session lifecycle types
42+
- `internal/git/` — git operations for commit amendment
43+
44+
<!-- program: .minions/programs/partio-attach-manual-session-link.md -->
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
id: stale-session-indicator-in-status
3+
target_repos:
4+
- cli
5+
pr_labels:
6+
- minion
7+
acceptance_criteria:
8+
- "`partio status` marks ACTIVE sessions with no interaction for >1 hour as stale"
9+
- "Stale sessions show a hint like `(stale — run 'partio doctor')` alongside their status"
10+
- "The staleness threshold (1 hour) matches the threshold used by `partio doctor`"
11+
- "Sessions with a nil `LastInteractionTime` fall back to `StartedAt` for staleness calculation"
12+
- "Non-stale ACTIVE sessions and all ENDED/IDLE sessions are unaffected"
13+
- "A unit test covers the stale-detection logic for both the nil-fallback and normal cases"
14+
---
15+
16+
# Add stale session indicator to `partio status` for stuck ACTIVE sessions
17+
18+
## Description
19+
20+
`partio status` currently shows session phase (ACTIVE, IDLE, ENDED) but gives no indication when an ACTIVE session has become stuck — for example when the Claude Code process exited without Partio detecting the session end. Users have no way to know they should run `partio doctor` to clean up.
21+
22+
Add a stale indicator to `partio status` output: if an ACTIVE session's `LastInteractionTime` (or `StartedAt` as fallback) is more than 1 hour ago, annotate it with a hint:
23+
24+
```
25+
● ACTIVE claude-code (stale — run 'partio doctor')
26+
started 3h ago, 0 commits
27+
```
28+
29+
The 1-hour threshold should be the same constant used by `partio doctor` for identifying stuck sessions, keeping the two commands consistent. The check is read-only — `partio status` should never modify session state.
30+
31+
## Context Hints
32+
33+
- `cmd/partio/` — status command rendering
34+
- `internal/session/` — session types and `LastInteractionTime` field
35+
- `internal/agent/` — agent session state phases (ACTIVE, IDLE, ENDED)
36+
37+
<!-- program: .minions/programs/stale-session-indicator-in-status.md -->

.minions/sources.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ sources:
1212
url: https://github.com/entireio/cli/pulls
1313
type: pulls
1414
repo: entireio/cli
15-
last_version: "851"
15+
last_version: "856"

0 commit comments

Comments
 (0)