Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/skills/browser-debugger/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: browser-debugger
description: "Open a browser (Chrome/Firefox/Edge) with remote-debugging port 9888 so Claude can inspect/control it — optionally starting `npm run dev` first and pointing the browser at it. Usage: /browser-debugger [--browser=chrome|firefox|edge] [--run-dev]. Read-only dev utility, no code changes, no seal gate."
description: "Open a browser (Chrome/Firefox/Edge) with remote-debugging port 9888 so Claude can inspect/control it — optionally starting `npm run dev` first and pointing the browser at it. Usage: /browser-debugger [--browser=chrome|firefox|edge] [--run-dev]. Read-only dev utility, no code changes, no seal gate. Use when Claude needs to inspect or drive a live browser page."
argument-hint: "[--browser=chrome|firefox|edge] [--run-dev]"
---

Expand Down
11 changes: 6 additions & 5 deletions .claude/skills/hub-health/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ echo "FLAGS:"
DIAG_FILE="$HUB/haven/diagrams/dev-loop.prime-mermaid.md"
if [ -f "$DIAG_FILE" ]; then
DB=$(wc -c < "$DIAG_FILE")
FULL_SEALED=$(grep -cE '\| SEALED \|' "$DIAG_FILE" 2>/dev/null)
POINTER_SEALED=$(grep -cE '— archived, see' "$DIAG_FILE" 2>/dev/null)
FULL_SEALED=$(grep -cE '^\| .*\| SEALED \|' "$DIAG_FILE" 2>/dev/null)
POINTER_SEALED=$(grep -cE '^\| .*— archived, see' "$DIAG_FILE" 2>/dev/null)
REAL_SEALED=$(( FULL_SEALED - POINTER_SEALED ))
check_threshold_bytes "dev-loop.prime-mermaid.md" "$DB" 15360 \
"$REAL_SEALED full SEALED entries not yet archived ($POINTER_SEALED pointers; verify_seal step 11 should keep these at 0 full / <=20 pointers — a backlog here predates that rule or means step 11 was skipped), see rows below"
Expand Down Expand Up @@ -213,7 +213,7 @@ def add(key, path):
k = (inp.get("file_path"), inp.get("offset"), inp.get("limit"))
reads.setdefault(k, []).append(size)
if name == "Bash" and err:
k = " ".join(str(inp.get("command", "")).split())[:120]
k = " ".join(str(inp.get("command", "")).split()) # full command: a long shared prefix (S=<scratchpad>…) isn't "the same command"
fails[k] = fails.get(k, 0) + 1
if size > 40000:
big.append((size, key, name, str(inp.get("file_path") or inp.get("command") or inp.get("description") or "")[:90]))
Expand Down Expand Up @@ -253,7 +253,7 @@ for fp, (n, ch) in top:
print(f" {n:>4}x {'image' if not ch else f'~{ch // 4} tok':>12} {fp}")
print(f" failing Bash command repeated >=3x in one run: {len(loops)}")
for cmd, n in sorted(loops.items(), key=lambda x: -x[1])[:5]:
print(f" {n:>4}x {cmd}")
print(f" {n:>4}x {cmd[:120]}")
print(f" tool results >40k chars (~10k tok): {len(big)}")
for size, who, name, what in sorted(big, reverse=True)[:5]:
print(f" ~{size // 4:>7} tok {who:15} {name}: {what}")
Expand Down Expand Up @@ -319,7 +319,8 @@ PY
`<path>/improvements/report/<YYYY-MM-DD>-#<NN>-hub-health-<project>.md`
— `<NN>` and the filename follow that repo's
`.claude/rules/improvements-naming.md` (read it first; next number
= highest `#` among `report/` filenames + 1, 2 digits). Sections:
per its rule, including its number floor — `report/` may be empty or
missing, create it). Sections:
`- **Recorded:**`, `- **Context:**` (project, kit version from
`agent-hub/.kit-version`, window), `- **Status:** unverified`,
`## Baseline` (output verbatim), `## Findings` (numbered: what,
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/issue-create/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: issue-create
description: "Create a GitHub issue in this repo. Drafts title/body, shows the exact gh command, waits for approval before creating."
description: "Create a GitHub issue in this repo. Drafts title/body, shows the exact gh command, waits for approval before creating. Use when the user wants a new issue filed."
argument-hint: "\"<what the issue is about>\" [--label x] [--assignee @me] [--yes]"
disable-model-invocation: true
---
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/issues-ls/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: issues-ls
description: "List open GitHub issues for this repo, if it's hosted on GitHub. Read-only, no side effects."
description: "List open GitHub issues for this repo, if it's hosted on GitHub. Read-only, no side effects. Use when picking the next task or reviewing the backlog."
argument-hint: "[--group] [--state open|closed|all] [gh issue list flags...]"
---

Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/persona-load/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: persona-load
description: "Load an on-demand expert-persona or a named panel from this project's own persona library (outside agent-hub/), printing the loader's SEALED output for the current worker session to read. Advisory only, read-only, no side effects."
description: "Load an on-demand expert-persona or a named panel from this project's own persona library (outside agent-hub/), printing the loader's SEALED output for the current worker session to read. Advisory only, read-only, no side effects. Use when a worker needs domain-expert guidance for the current task."
argument-hint: "<category>/<name> | -p <panel> | -l [category]"
---

Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/release/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: release
description: "Promote staging into main by running the bundled release.sh: build/test gate, real merge commit (no squash), semver bump + tag vX.Y.Z, deploy via DEPLOY_HOOK_URL or report the deploy workflow run, sync the bump back to staging, close shipped issues (Closes #n in the release PR, read from the merged PRs). Usage: /release [patch|minor|major]. Invoking this skill IS the operator's go-ahead — no separate confirmation prompt."
description: "Promote staging into main by running the bundled release.sh: build/test gate, real merge commit (no squash), semver bump + tag vX.Y.Z, deploy via DEPLOY_HOOK_URL or report the deploy workflow run, sync the bump back to staging, close shipped issues (Closes #n in the release PR, read from the merged PRs). Usage: /release [patch|minor|major]. Invoking this skill IS the operator's go-ahead — no separate confirmation prompt. Use when staging is ready to go to production."
argument-hint: "[patch|minor|major]"
disable-model-invocation: true
---
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/ship/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: ship
description: "Commit + push a SEALED node via the bundled ship.sh — the outward-facing gate at the end of the loop. Usage: /ship \"[note]\" or /ship \"[note]\" --merge[=branch] to also merge into a target branch (directly, or through a GitHub PR + required CI when ship.env sets SHIP_MERGE_VIA=pr). Prints the exact git commands, then runs them at once — invoking /ship is the approval. Never --force/--no-verify."
description: "Commit + push a SEALED node via the bundled ship.sh — the outward-facing gate at the end of the loop. Usage: /ship \"[note]\" or /ship \"[note]\" --merge[=branch] to also merge into a target branch (directly, or through a GitHub PR + required CI when ship.env sets SHIP_MERGE_VIA=pr). Prints the exact git commands, then runs them at once — invoking /ship is the approval. Never --force/--no-verify. Use when a node is SEALED and the work should be committed."
argument-hint: "[note] [--merge[=<branch>]]"
---

Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/spec-backfill/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: spec-backfill
description: "Bulk-backfill draft feature docs (doctrine/features/) for features that already exist in the code. Writes only agent-hub docs, never code. Docs stay draft until confirmed via /worker analyst."
description: "Bulk-backfill draft feature docs (doctrine/features/) for features that already exist in the code. Writes only agent-hub docs, never code. Docs stay draft until confirmed via /worker analyst. Use when adopting agent-hub in a codebase whose existing features have no docs."
argument-hint: "[<area or path to limit the scan>]"
---

Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/todo/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: todo
description: "Resolve/create a GitHub issue + check out that issue's own branch, then combine /worker analyst (feature, or a bug with no feature doc yet), /worker implementer and /worker verifier into 1 typed command for a task — still runs 2 separate passes inside, looping automatically on REOPEN. Usage: /todo \"[task]\"|#[issue-number] [--ship]"
description: "Resolve/create a GitHub issue + check out that issue's own branch, then combine /worker analyst (feature, or a bug with no feature doc yet), /worker implementer and /worker verifier into 1 typed command for a task — still runs 2 separate passes inside, looping automatically on REOPEN. Usage: /todo \"[task]\"|#[issue-number] [--ship] Use when running any feat or fix task end-to-end."
argument-hint: "<task>|#<issue-number> [--ship]"
disable-model-invocation: true
---
Expand Down
8 changes: 7 additions & 1 deletion .claude/skills/worker/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: worker
description: "Become an agent-hub worker (analyst, implementer or verifier) and carry out one task following exactly that worker's recipe. Usage: /worker [analyst|implementer|verifier] \"[task]\""
description: "Become an agent-hub worker (analyst, implementer or verifier) and carry out one task following exactly that worker's recipe. Usage: /worker [analyst|implementer|verifier] \"[task]\" Use when running one loop role by hand instead of /todo."
argument-hint: <analyst|implementer|verifier> "<task>"
---

Expand Down Expand Up @@ -53,6 +53,12 @@ argument-hint: <analyst|implementer|verifier> "<task>"
`recipes/verify_seal.md` step 1b makes the verifier record its own
spawn proof in the `## Isolation proof` line of the verdict note, so
a later audit can detect a skipped context split. (kit 2026-11-07)
Spawn it with `model: "sonnet"` (it checks cited evidence against
criteria, doesn't design). The spawn prompt names the absolute hub
path, the note path(s) and node slug(s) — never make the subagent
`ls` around to find its inputs, and never add re-run instructions
("re-run the checks yourself") — `verify_seal.md`'s "Re-run scope"
alone decides. (kit 2026-11-18)
Only exception to a fresh spawn: `/todo`'s REOPEN rounds resume the
same verifier subagent (`todo` step 3) — still never the
implementer's context.
Expand Down
2 changes: 1 addition & 1 deletion agent-hub/.kit-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
af32868
e900251
3 changes: 3 additions & 0 deletions agent-hub/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ its content/diff into the session, even the first time a file is
created. Just report one line "📝 agent-hub: updated" and move on; report
done when finished. Real diffs/code (outside `agent-hub/`) still display
normally — that's what the operator actually needs to see.
Every tool call re-sends the whole context: batch independent read-only
lookups (greps, file reads, `ls`) into ONE Bash call instead of one call
each.

## Master Equation
**Aligned = Purpose × Evidence × Care** — a multiplication, not an
Expand Down
2 changes: 1 addition & 1 deletion agent-hub/doctrine/domains/PROJECT.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Repo: `github.com/datvt243/resume-nodejs-api`. Author: DatVT.
`npm run build`.

## Branch naming
Branch naming: `<type>/<issue-number>-<desc-max-3-words>` — type = `feature`/`fix`/`hotfix`/`refactor`/`perf`/`chore`, desc = at most 3 kebab-case words (e.g. `fix/408-general-info-confirm`). Changed 2026-11-16 from `<number>-<slug>` (operator request). Pick type from the issue: label `bug` → `fix` (`hotfix` if it must skip the normal release cadence), `enhancement`/`feature` → `feature`, else the title's leading verb (refactor/perf/chore…); unclear → ask.
Branch naming: `<type>/<issue-number>-<desc-max-3-words>` — type = `feature`/`fix`/`hotfix`/`refactor`/`perf`/`chore`, desc = at most 3 kebab-case words (e.g. `fix/408-general-info-confirm`); kept over kit default). Changed 2026-11-16 from `<number>-<slug>` (operator request). Pick type from the issue: label `bug` → `fix` (`hotfix` if it must skip the normal release cadence), `enhancement`/`feature` → `feature`, else the title's leading verb (refactor/perf/chore…); unclear → ask.

## Diagram-first
The diagram (`haven/diagrams/`) is the source of truth for progress — code
Expand Down
7 changes: 5 additions & 2 deletions agent-hub/evidence/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ Date in `YYYY-mm-dd` format, slug in kebab-case taken from the task name.
- `## Acceptance` — a table | Criterion | Evidence | (evidence points to
a specific line of output — never a bare "tests pass", must cite
"Tests: 42 passed, 42 total"); always has a "comments per
code-comments.md" row
code-comments.md" row. A coverage claim ("only caller", "no other
path reads X") cites the exact search command + its output, so the
verifier audits it without re-searching
- `## Supersedes` / `## Still open` — other
not-yet-SEALED rows for the same issue: retired by this node on SEAL,
or kept open with a reason (`recipes/implement.md` step 7b); `none` if
Expand Down Expand Up @@ -111,7 +113,8 @@ Date in `YYYY-mm-dd` format, slug in kebab-case taken from the task name.
move lines older than the current work session to
`evidence/worker-runs-archive.log` (same directory, plain append,
create it lazily on first use) — copy each line VERBATIM, never
reformat/summarize. Checked by `/hub-health`. Same "delete nothing"
reformat/summarize. Done by `verify_seal` step 13b; `/hub-health`
flags a miss. Same "delete nothing"
rule as the active file — this is a move, not a cleanup.

## Format — ship note
Expand Down
71 changes: 71 additions & 0 deletions agent-hub/evidence/ship/2026-11-18/fix-access-token-jti-ship.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Ship — fix-access-token-jti
- Node: `fix-access-token-jti` (SEALED, `agent-hub/evidence/verifier/2026-11-18/fix-access-token-jti-seal.md`) · Branch: `fix/490-access-token-jti` · Remote: `https://github.com/datvt243/resume-nodejs-api.git`

## Commands
- `git commit -m "fix(auth): give every JWT a unique jti so same-second sessions don't collide

Access tokens were signed with { _id } only, so two issued for one candidate in the same second were byte-identical and logging out one session blacklisted the other.

- src/utils/jwt.ts: jwtSign sets jwtid: crypto.randomUUID() on every token (access and refresh)
- src/auth/auth.service.ts, src/auth/auth.controller.ts: drop the hand-built refresh jti (jsonwebtoken rejects payload jti + jwtid) and the now-unused crypto import
- tests: new src/__tests__/utils/jwt.test.ts; integration test for two same-second logins where logout of one leaves the other at 200; caller unit tests and refreshTokenReuse helper adjusted
- .claude/rules/api.md: auth flow payload now { _id, jti }
- agent-hub: ship note for auth-http-integration-tests

npm test: Test Suites: 75 passed, 75 total / Tests: 792 passed, 792 total
npm run build: exit 0 (tsc exit 0); lint 273 problems (<= 274 baseline), none new in changed files

Node: fix-access-token-jti (SEALED)
Evidence: agent-hub/evidence/verifier/2026-11-18/fix-access-token-jti-seal.md

Closes #490

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>"`
- `git push -u origin fix/490-access-token-jti`
- `gh pr create --base staging --head fix/490-access-token-jti (reuse an open one)`
- `gh pr checks <pr> --watch --required`
- `gh pr merge <pr> --merge`
- `git checkout staging`
- `git pull --ff-only origin staging`

## Output
Commit: `df91bcc`
```
$ git commit -m fix(auth): give every JWT a unique jti so same-second sessions don't collide

Access tokens were signed with { _id } only, so two issued for one candidate in the same second were byte-identical and logging out one session blacklisted the other.

- src/utils/jwt.ts: jwtSign sets jwtid: crypto.randomUUID() on every token (access and refresh)
- src/auth/auth.service.ts, src/auth/auth.controller.ts: drop the hand-built refresh jti (jsonwebtoken rejects payload jti + jwtid) and the now-unused crypto import
- tests: new src/__tests__/utils/jwt.test.ts; integration test for two same-second logins where logout of one leaves the other at 200; caller unit tests and refreshTokenReuse helper adjusted
- .claude/rules/api.md: auth flow payload now { _id, jti }
- agent-hub: ship note for auth-http-integration-tests

npm test: Test Suites: 75 passed, 75 total / Tests: 792 passed, 792 total
npm run build: exit 0 (tsc exit 0); lint 273 problems (<= 274 baseline), none new in changed files

Node: fix-access-token-jti (SEALED)
Evidence: agent-hub/evidence/verifier/2026-11-18/fix-access-token-jti-seal.md

Closes #490

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
[fix/490-access-token-jti df91bcc] fix(auth): give every JWT a unique jti so same-second sessions don't collide
16 files changed, 279 insertions(+), 17 deletions(-)
create mode 100644 agent-hub/evidence/implementer/2026-11-18/fix-access-token-jti-diff.md
create mode 100644 agent-hub/evidence/implementer/2026-11-18/fix-access-token-jti-plan.md
create mode 100644 agent-hub/evidence/ship/2026-11-18/auth-http-integration-tests-ship.md
create mode 100644 agent-hub/evidence/verifier/2026-11-18/fix-access-token-jti-seal.md
create mode 100644 src/__tests__/utils/jwt.test.ts
$ git push -u origin fix/490-access-token-jti
To https://github.com/datvt243/resume-nodejs-api.git
de5fd4f..df91bcc fix/490-access-token-jti -> fix/490-access-token-jti
branch 'fix/490-access-token-jti' set up to track 'origin/fix/490-access-token-jti'.
PR: https://github.com/datvt243/resume-nodejs-api/pull/491
build (20.x) pass 1m12s https://github.com/datvt243/resume-nodejs-api/actions/runs/44279792722/job/134717130395
build (22.x) pass 1m5s https://github.com/datvt243/resume-nodejs-api/actions/runs/44279792722/job/134717130906
$ gh pr merge 491 --merge
```

## Seal gate
Approved by the operator invoking /ship (AutoCommitNoGate), covering the whole chain above.
Loading
Loading