docs(plans): patch Plan 5 — test helper sessions/ subdir + sessionlog docstring step
Two corrections applied during Plan 5 execution:
- Task 2 test helper writeSession now joins a sessions/ subdir so it
matches the handler's <brainDir>/sessions/*.jsonl scan path.
(The original heredoc would have produced 0 records in tests.)
- Task 6 grew a Step 1.5 to update the session_log MCP tool's
final_status description, picking up a spec requirement that
didn't translate into a task in the original plan.
This commit is contained in:
@@ -167,10 +167,14 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
// writeSession writes one or more JSONL entries to <dir>/<sessionID>.jsonl.
|
// writeSession writes one or more JSONL entries to <dir>/sessions/<sessionID>.jsonl.
|
||||||
|
// The handler scans <brainDir>/sessions/*.jsonl, so the helper creates the
|
||||||
|
// sessions/ subdir to match the production layout.
|
||||||
func writeSession(t *testing.T, dir, sessionID string, entries ...string) {
|
func writeSession(t *testing.T, dir, sessionID string, entries ...string) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
path := filepath.Join(dir, sessionID+".jsonl")
|
sessionsDir := filepath.Join(dir, "sessions")
|
||||||
|
require.NoError(t, os.MkdirAll(sessionsDir, 0o755))
|
||||||
|
path := filepath.Join(sessionsDir, sessionID+".jsonl")
|
||||||
body := ""
|
body := ""
|
||||||
for _, e := range entries {
|
for _, e := range entries {
|
||||||
body += e + "\n"
|
body += e + "\n"
|
||||||
@@ -942,6 +946,7 @@ Update `cmd/hyperguild/README.md` to document the new `pass-rate` subcommand. Up
|
|||||||
**Files:**
|
**Files:**
|
||||||
- Modify: `cmd/hyperguild/README.md` (add `pass-rate` subcommand block)
|
- Modify: `cmd/hyperguild/README.md` (add `pass-rate` subcommand block)
|
||||||
- Modify: `CLAUDE.md` (mention `/pass-rate` in the brain HTTP REST API section)
|
- Modify: `CLAUDE.md` (mention `/pass-rate` in the brain HTTP REST API section)
|
||||||
|
- Modify: `internal/skills/sessionlog/skill.go` (or wherever the `session_log` MCP tool is registered) — update the `final_status` description from `ok | error | skipped` to `pass | fail | skip (legacy: ok | error | skipped accepted)` so the agent-facing tool definition matches the new SKILL.md vocabulary
|
||||||
|
|
||||||
- [ ] **Step 1: Update the CLI README**
|
- [ ] **Step 1: Update the CLI README**
|
||||||
|
|
||||||
@@ -978,6 +983,21 @@ Skills with no logged invocations return zero counts and `pass_rate: null`
|
|||||||
(indicating "no data", distinct from "always passes").
|
(indicating "no data", distinct from "always passes").
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- [ ] **Step 1.5: Update the `session_log` MCP tool's `final_status` description**
|
||||||
|
|
||||||
|
Find the `session_log` tool registration in the supervisor (`internal/skills/sessionlog/`). Update the `final_status` field's description string to read:
|
||||||
|
|
||||||
|
```
|
||||||
|
pass | fail | skip (legacy: ok | error | skipped also accepted)
|
||||||
|
```
|
||||||
|
|
||||||
|
This keeps the agent-facing schema honest — Plan 5's SKILL.md contract uses the new vocabulary. The aggregator normalizes both for backward compat, but the tool's docstring should lead with the new vocabulary.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
grep -rn "ok | error | skipped\|final_status.*description" ~/dev/AI/hyperguild/.worktrees/pass-rate-endpoint/internal/skills/sessionlog/ ~/dev/AI/hyperguild/.worktrees/pass-rate-endpoint/ingestion/internal/skills/sessionlog/ 2>/dev/null | head
|
||||||
|
# Locate the registration; update the description string verbatim.
|
||||||
|
```
|
||||||
|
|
||||||
- [ ] **Step 2: Update CLAUDE.md**
|
- [ ] **Step 2: Update CLAUDE.md**
|
||||||
|
|
||||||
Find the section in `CLAUDE.md` that documents the brain HTTP REST API (look for `## MCP endpoints` or similar). After the existing endpoint list, add a note about `/pass-rate`:
|
Find the section in `CLAUDE.md` that documents the brain HTTP REST API (look for `## MCP endpoints` or similar). After the existing endpoint list, add a note about `/pass-rate`:
|
||||||
|
|||||||
Reference in New Issue
Block a user