From 1a808c3f32c45f06c621f9d48ffe1df886c86d02 Mon Sep 17 00:00:00 2001 From: _david Date: Thu, 19 Nov 2026 16:31:20 +0700 Subject: [PATCH] =?UTF-8?q?chore(agent-hub):=20sync=20kit=20af32868=20?= =?UTF-8?q?=E2=86=92=20e900251=20(verifier=20on=20Sonnet,=20batched=20look?= =?UTF-8?q?ups,=20worker-runs=20rotation)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - agent-hub/: CLAUDE.md batch-lookup rule, verifier manifest reads evidence/README.md, verify_seal re-run scope / one-call reads / pointer cap / worker-runs rotation (13b), evidence README coverage-claim rule; PROJECT.md branch naming marked "kept over kit default" (operator approved); ship notes for fix-access-token-jti and hide-password-select-false (2026-11-18) left uncommitted by ship.sh - .claude/skills/: hub-health grep/loop/report fixes, worker verifier on Sonnet, "Use when" descriptions, issues-ls description - Kit mechanism only, no code — no node, no test run needed Co-Authored-By: Claude Sonnet 5 --- .claude/skills/browser-debugger/SKILL.md | 2 +- .claude/skills/hub-health/SKILL.md | 11 +-- .claude/skills/issue-create/SKILL.md | 2 +- .claude/skills/issues-ls/SKILL.md | 2 +- .claude/skills/persona-load/SKILL.md | 2 +- .claude/skills/release/SKILL.md | 2 +- .claude/skills/ship/SKILL.md | 2 +- .claude/skills/spec-backfill/SKILL.md | 2 +- .claude/skills/todo/SKILL.md | 2 +- .claude/skills/worker/SKILL.md | 8 ++- agent-hub/.kit-version | 2 +- agent-hub/CLAUDE.md | 3 + agent-hub/doctrine/domains/PROJECT.md | 2 +- agent-hub/evidence/README.md | 7 +- .../2026-11-18/fix-access-token-jti-ship.md | 71 +++++++++++++++++++ .../hide-password-select-false-ship.md | 69 ++++++++++++++++++ .../haven/workers/verifier/manifest.yaml | 2 +- .../workers/verifier/recipes/verify_seal.md | 30 ++++++-- 18 files changed, 196 insertions(+), 25 deletions(-) create mode 100644 agent-hub/evidence/ship/2026-11-18/fix-access-token-jti-ship.md create mode 100644 agent-hub/evidence/ship/2026-11-18/hide-password-select-false-ship.md diff --git a/.claude/skills/browser-debugger/SKILL.md b/.claude/skills/browser-debugger/SKILL.md index ebc570e5..a543a836 100644 --- a/.claude/skills/browser-debugger/SKILL.md +++ b/.claude/skills/browser-debugger/SKILL.md @@ -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]" --- diff --git a/.claude/skills/hub-health/SKILL.md b/.claude/skills/hub-health/SKILL.md index 6645a50a..0bbbed8f 100644 --- a/.claude/skills/hub-health/SKILL.md +++ b/.claude/skills/hub-health/SKILL.md @@ -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" @@ -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=…) 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])) @@ -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}") @@ -319,7 +319,8 @@ PY `/improvements/report/-#-hub-health-.md` — `` 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, diff --git a/.claude/skills/issue-create/SKILL.md b/.claude/skills/issue-create/SKILL.md index 1e57097a..8975cbe4 100644 --- a/.claude/skills/issue-create/SKILL.md +++ b/.claude/skills/issue-create/SKILL.md @@ -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: "\"\" [--label x] [--assignee @me] [--yes]" disable-model-invocation: true --- diff --git a/.claude/skills/issues-ls/SKILL.md b/.claude/skills/issues-ls/SKILL.md index 352e085d..8a67e1f6 100644 --- a/.claude/skills/issues-ls/SKILL.md +++ b/.claude/skills/issues-ls/SKILL.md @@ -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...]" --- diff --git a/.claude/skills/persona-load/SKILL.md b/.claude/skills/persona-load/SKILL.md index be533dcb..31ff9c24 100644 --- a/.claude/skills/persona-load/SKILL.md +++ b/.claude/skills/persona-load/SKILL.md @@ -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: "/ | -p | -l [category]" --- diff --git a/.claude/skills/release/SKILL.md b/.claude/skills/release/SKILL.md index 143ab01d..51d14de2 100644 --- a/.claude/skills/release/SKILL.md +++ b/.claude/skills/release/SKILL.md @@ -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 --- diff --git a/.claude/skills/ship/SKILL.md b/.claude/skills/ship/SKILL.md index 1624b3f5..0f797672 100644 --- a/.claude/skills/ship/SKILL.md +++ b/.claude/skills/ship/SKILL.md @@ -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[=]]" --- diff --git a/.claude/skills/spec-backfill/SKILL.md b/.claude/skills/spec-backfill/SKILL.md index fe2914de..4cbc50d6 100644 --- a/.claude/skills/spec-backfill/SKILL.md +++ b/.claude/skills/spec-backfill/SKILL.md @@ -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: "[]" --- diff --git a/.claude/skills/todo/SKILL.md b/.claude/skills/todo/SKILL.md index 7a904839..e2b7454f 100644 --- a/.claude/skills/todo/SKILL.md +++ b/.claude/skills/todo/SKILL.md @@ -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: "|# [--ship]" disable-model-invocation: true --- diff --git a/.claude/skills/worker/SKILL.md b/.claude/skills/worker/SKILL.md index 9b345c2d..1cbc1bd1 100644 --- a/.claude/skills/worker/SKILL.md +++ b/.claude/skills/worker/SKILL.md @@ -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: "" --- @@ -53,6 +53,12 @@ argument-hint: "" `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. diff --git a/agent-hub/.kit-version b/agent-hub/.kit-version index 42d48985..511d91ff 100644 --- a/agent-hub/.kit-version +++ b/agent-hub/.kit-version @@ -1 +1 @@ -af32868 +e900251 diff --git a/agent-hub/CLAUDE.md b/agent-hub/CLAUDE.md index 1b7294af..f2b31bfd 100644 --- a/agent-hub/CLAUDE.md +++ b/agent-hub/CLAUDE.md @@ -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 diff --git a/agent-hub/doctrine/domains/PROJECT.md b/agent-hub/doctrine/domains/PROJECT.md index 3cf71df2..0ac06a68 100644 --- a/agent-hub/doctrine/domains/PROJECT.md +++ b/agent-hub/doctrine/domains/PROJECT.md @@ -30,7 +30,7 @@ Repo: `github.com/datvt243/resume-nodejs-api`. Author: DatVT. `npm run build`. ## Branch naming -Branch naming: `/-` — 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 `-` (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 = `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 `-` (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 diff --git a/agent-hub/evidence/README.md b/agent-hub/evidence/README.md index e2926495..5fafa2b8 100644 --- a/agent-hub/evidence/README.md +++ b/agent-hub/evidence/README.md @@ -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 @@ -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 diff --git a/agent-hub/evidence/ship/2026-11-18/fix-access-token-jti-ship.md b/agent-hub/evidence/ship/2026-11-18/fix-access-token-jti-ship.md new file mode 100644 index 00000000..f2d38dd6 --- /dev/null +++ b/agent-hub/evidence/ship/2026-11-18/fix-access-token-jti-ship.md @@ -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 "` +- `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 --watch --required` +- `gh pr merge --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 +[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. diff --git a/agent-hub/evidence/ship/2026-11-18/hide-password-select-false-ship.md b/agent-hub/evidence/ship/2026-11-18/hide-password-select-false-ship.md new file mode 100644 index 00000000..7f082f8b --- /dev/null +++ b/agent-hub/evidence/ship/2026-11-18/hide-password-select-false-ship.md @@ -0,0 +1,69 @@ +# Ship — hide-password-select-false +- Node: `hide-password-select-false` (SEALED, `agent-hub/evidence/verifier/2026-11-18/hide-password-select-false-seal.md`) · Branch: `refactor/459-hide-password-select` · Remote: `https://github.com/datvt243/resume-nodejs-api.git` + +## Commands +- `git commit -m "refactor(candidate): hide password at schema level with select: false + +- models/candidate.model.ts: password gets select: false, so no query + returns the hash unless it opts in +- auth/auth.service.ts: handlerLogin (only hash reader) opts in with + .select('+password'); reset writes via updateOne, unchanged +- tests: login mocks chain .select and assert '+password'; new + models/candidatePassword.test.ts asserts a plain findById() sends + projection { password: 0 } (red without the fix) + +npm test: Test Suites: 73 passed, 73 total; Tests: 784 passed, 784 total +npm run build: exit 0 (tsc typecheck); lint 274 = baseline, 0 new + +Node: hide-password-select-false (SEALED) +Evidence: agent-hub/evidence/verifier/2026-11-18/hide-password-select-false-seal.md + +Closes #459 + +Co-Authored-By: Claude Sonnet 5 "` +- `git push -u origin refactor/459-hide-password-select` +- `gh pr create --base staging --head refactor/459-hide-password-select (reuse an open one)` +- `gh pr checks --watch --required` +- `gh pr merge --merge` +- `git checkout staging` +- `git pull --ff-only origin staging` + +## Output +Commit: `41df4ae` +``` +$ git commit -m refactor(candidate): hide password at schema level with select: false + +- models/candidate.model.ts: password gets select: false, so no query + returns the hash unless it opts in +- auth/auth.service.ts: handlerLogin (only hash reader) opts in with + .select('+password'); reset writes via updateOne, unchanged +- tests: login mocks chain .select and assert '+password'; new + models/candidatePassword.test.ts asserts a plain findById() sends + projection { password: 0 } (red without the fix) + +npm test: Test Suites: 73 passed, 73 total; Tests: 784 passed, 784 total +npm run build: exit 0 (tsc typecheck); lint 274 = baseline, 0 new + +Node: hide-password-select-false (SEALED) +Evidence: agent-hub/evidence/verifier/2026-11-18/hide-password-select-false-seal.md + +Closes #459 + +Co-Authored-By: Claude Sonnet 5 +[refactor/459-hide-password-select 41df4ae] refactor(candidate): hide password at schema level with select: false + 9 files changed, 214 insertions(+), 7 deletions(-) + create mode 100644 agent-hub/evidence/implementer/2026-11-18/hide-password-select-false.md + create mode 100644 agent-hub/evidence/verifier/2026-11-18/hide-password-select-false-seal.md + create mode 100644 src/__tests__/models/candidatePassword.test.ts +$ git push -u origin refactor/459-hide-password-select +To https://github.com/datvt243/resume-nodejs-api.git + b1ea2be..41df4ae refactor/459-hide-password-select -> refactor/459-hide-password-select +branch 'refactor/459-hide-password-select' set up to track 'origin/refactor/459-hide-password-select'. +PR: https://github.com/datvt243/resume-nodejs-api/pull/488 +build (20.x) pass 1m36s https://github.com/datvt243/resume-nodejs-api/actions/runs/44271973245/job/134690561564 +build (22.x) pass 1m5s https://github.com/datvt243/resume-nodejs-api/actions/runs/44271973245/job/134690562088 +$ gh pr merge 488 --merge +``` + +## Seal gate +Approved by the operator invoking /ship (AutoCommitNoGate), covering the whole chain above. diff --git a/agent-hub/haven/workers/verifier/manifest.yaml b/agent-hub/haven/workers/verifier/manifest.yaml index b3f62b93..b5e9da8f 100644 --- a/agent-hub/haven/workers/verifier/manifest.yaml +++ b/agent-hub/haven/workers/verifier/manifest.yaml @@ -12,7 +12,7 @@ hard_rules: - EvidenceOnly # never trust reasoning in place of real evidence - NeverVerifyOwnWork # never grade a diff you wrote yourself - RatchetOnly # PM status only moves forward, never backward -reads: [evidence/implementer/, haven/diagrams/, doctrine/MEMORY.md, CLAUDE.md] +reads: [evidence/implementer/, evidence/README.md, haven/diagrams/, doctrine/MEMORY.md, CLAUDE.md] # doctrine/MEMORY.md: recipe step 4 needs to check the command in the note. # No NORTHSTAR.md — the recipe never uses it, a wasted read on every subagent spawn. # + the ONE doctrine/features/.md the note's `## Feature doc` line cites. diff --git a/agent-hub/haven/workers/verifier/recipes/verify_seal.md b/agent-hub/haven/workers/verifier/recipes/verify_seal.md index fb9c1494..8abdf39e 100644 --- a/agent-hub/haven/workers/verifier/recipes/verify_seal.md +++ b/agent-hub/haven/workers/verifier/recipes/verify_seal.md @@ -55,8 +55,11 @@ Only re-run (partially or fully) when: command doesn't match doctrine → REOPEN immediately per steps 4-5, don't waste effort re-running an already-broken note "to be sure" — REOPEN and let the implementer write a correct note. -- The node is outward-facing or is a `/release` gate — higher risk than - an ordinary diff, worth the cost of an independent confirmation. +- The node itself performs an outward-facing action (the SEAL GATE list + in `CLAUDE.md`: push, publish, deploy, external API call...) or is a + `/release` gate — higher risk than an ordinary diff, worth the cost of + an independent confirmation. Code that reaches production later + through `/ship` does NOT count — on a website that's every change. - `doctrine/domains/PROJECT.md` explicitly lists this class of change as needing independent re-running (a per-project decision, not the kit's default). @@ -96,7 +99,12 @@ so every hub doesn't reason about it differently. a later audit that the subagent-spawn rule in `worker/SKILL.md` was skipped this round. 2. [LOOP STARTS HERE FOR EACH NODE if batch] Read the NOTE — only the - note, do NOT open the diff itself directly. (`EvidenceOnly`) + note, do NOT open the diff itself directly. (`EvidenceOnly`) One Bash + call: the note + the node row (`grep -n ''` on the active + diagram) + `doctrine/MEMORY.md` + `evidence/README.md`; the cited + feature doc (step 6b) in at most one more. A claim the note backs + with a cited search is audited from that citation — never re-run the + search. 3. Read the NODE — get the acceptance criteria from `haven/diagrams/`, the forbidden states from `CLAUDE.md`. [GUARD] Don't `Read agent-hub/CLAUDE.md` separately for this — same mechanism @@ -115,7 +123,9 @@ so every hub doesn't reason about it differently. 6. Go through the acceptance criteria ONE BY ONE — any missing evidence = REOPEN, state it clearly under "missing". Always includes the "comments per code-comments.md" row (see that standard's - Enforcement), even if the node's own criteria don't list it. Also: an open row for the same issue exists on the + Enforcement), even if the node's own criteria don't list it. A + coverage claim ("only caller", "no other path reads X") without its + exact search command + output = missing evidence. Also: an open row for the same issue exists on the active diagram but the note has no `## Supersedes`/`## Still open` line for it → REOPEN (implement step 7b skipped). 6b. Feature doc: the note has no `## Feature doc` line → REOPEN @@ -145,8 +155,11 @@ so every hub doesn't reason about it differently. `haven/diagrams/dev-loop-archive.md` (create it from §9️⃣.5 if absent); (b) replace the active row with `| node | SEALED | — archived, see dev-loop-archive.md. - Evidence: |`; (c) if the active PM status - now holds more than 20 such pointer rows, delete the oldest ones + Evidence: |`; (c) after (b) — always, also + when (b) replaced a PENDING row in place (that adds a pointer too) — + `grep -cE '^\| .*— archived, see'` the active file (table rows only); + more than 20 → delete the + oldest pointer lines until 20 remain (their full row already lives in the archive) — delete the whole line, leave no blank line; the table stays the file's last block (diagram PM status note); (d) for each row the @@ -196,6 +209,11 @@ so every hub doesn't reason about it differently. on how it's invoked, since it lives directly in this recipe, not in `/todo`. NEVER edit/delete an old line in this file, only append (the same principle as every other file in `evidence/`). +13b. After the append: `worker-runs.log` over 15KB (`wc -c`) → move + every line dated before today to `evidence/worker-runs-archive.log` + (`>>`, verbatim, create it lazily), keep today's lines — the + `evidence/README.md` TOKEN DISCIPLINE move, the only removal this + file allows. ## Hard rules honored `NeverVerifyOwnWork` | `EvidenceOnly` | `VerdictOnly` | `RatchetOnly`