---
name: verify-ntn-skills
description: Project-local end-to-end verification skill and feature map for ntn-skills (CLI dist/bin.js, full-direction Notion <-> Git provenance state machine, zero-fork Local Patch/Custom Description, stdio MCP, Pi extension, and TLA+ invariants). Use for /maintain-verification-skill or before shipping changes to sync, edit, migrate, store, Notion client, or Pi extension.
---
# Verify ntn-skills
Drives the compiled `packages/cli/dist/bin.js` binary against an isolated filesystem sandbox, real local bare Git repositories (`repo-a.git` and `repo-b.git`), and the dedicated Notion integration test page (`4295636c-236e-81e2-b468-ca0aecc3877e`) with kernel-enforced production write locks (`NTN_SKILLS_TEST_ONLY=1`).
## Launch
`ntn-skills` is a short-lived CLI (plus on-demand `mcp` stdio mode). Build the standalone bundle once, then provision a fresh isolated sandbox per verification pass:
```bash
bun run build
EVIDENCE_DIR="$(mktemp -d "${TMPDIR:-/tmp}/ntn-verify-evidence.XXXXXX")"
VERIFY_ROOT="$(.pi/skills/verify-ntn-skills/scripts/setup-sandbox.sh "$EVIDENCE_DIR")"
# shellcheck source=/dev/null
source "$VERIFY_ROOT/env.sh"
```
`setup-sandbox.sh` performs 4 isolated setup steps without touching `~/.config/ntn-skills` or `~/.agents/skills`:
1. Allocates `$VERIFY_ROOT/{home,config,export-agents,export-copy}` and copies only `NOTION_TOKEN` (mode `0600`) from `~/.config/ntn-skills/credentials.env` (if present).
2. Exports `NTN_SKILLS_TEST_ONLY=1`, `NTN_SKILLS_PROTECTED_LIBRARY_IDS=40c5636c-236e-80e1-b440-c6d4b8310b72`, and `NTN_SKILLS_TEST_LIBRARY_ID=4295636c-236e-81e2-b468-ca0aecc3877e` in `$VERIFY_ROOT/env.sh`.
3. Initializes two real bare Git remotes (`$VERIFY_ROOT/remotes/repo-a.git` and `repo-b.git` with SHA-1 fetch enabled) and two working clones (`$VERIFY_ROOT/work-a` and `$VERIFY_ROOT/work-b`).
4. Bootstraps/binds the 3 Notion tables (`Sources`, `Skills`, `Files`) on `$NTN_SKILLS_TEST_LIBRARY_ID` via `$NTN_BIN init`.
Teardown is mandatory after every run (including failed runs):
```bash
.pi/skills/verify-ntn-skills/scripts/cleanup-sandbox.sh "$VERIFY_ROOT" "$EVIDENCE_DIR"
```
## Doctor
Run the read-only health & isolation preflight before driving any feature, and again after any unexpected failure:
```bash
.pi/skills/verify-ntn-skills/scripts/doctor-sandbox.sh "$VERIFY_ROOT"
<!-- ‹guest · 2026-12-05› -->
```
`doctor-sandbox.sh` verifies:
1. `packages/cli/dist/bin.js` exists and reports the current `packages/cli/package.json` version;
2. Attempting a mutating command against protected production library `40c5636c-236e-80e1-b440-c6d4b8310b72` fails closed with `[ConflictError] Blocked write to production library` (exit code `2`);
3. `$NTN_BIN doctor --json </dev/null` against `$NTN_SKILLS_TEST_LIBRARY_ID` returns `"ok": true` with `0` failed checks;
4. Both local Git checkouts (`work-a`, `work-b`) push cleanly to their bare remotes.
If `NOTION_TOKEN` is absent on a machine (e.g., unauthenticated CI), `setup-sandbox.sh` marks live Notion journeys `verified-unreachable` (prerequisite: `~/.config/ntn-skills/credentials.env` with `NOTION_TOKEN` granted access to `4295636c-236e-81e2-b468-ca0aecc3877e`), and only the deterministic gate (`NTN_SKILLS_TEST_ONLY=1 bun run check` + `verification/run-tlc.sh`) runs.
## Drive
Always source `$VERIFY_ROOT/env.sh` and invoke `$NTN_BIN` with `</dev/null` on non-interactive commands so subprocesses never hang on stdin:
```bash
source "$VERIFY_ROOT/env.sh"
$NTN_BIN status --json </dev/null | tee "$EVIDENCE_DIR/status.json"
$NTN_BIN doctor --json </dev/null | tee "$EVIDENCE_DIR/doctor.json"
```
Drive mapped user journeys in [`features/README.md`](features/README.md). Never mutate `$VERIFY_ROOT/home/store/` in place (snapshots are `0444/0555` immutable), and never bypass `$NTN_BIN` with internal TypeScript setters when proving CLI journeys.
## Evidence
All proof artifacts are written to `$EVIDENCE_DIR` (outside `$VERIFY_ROOT` so `cleanup-sandbox.sh` never deletes them):
- Command transcripts and JSON outputs (`*.json`, `*.log`);
- Pre/post `Skill ID` continuity assertions across `new -> migrate (Repo A) -> migrate (Repo B) -> detach (Notion)`;
- Direct Notion `Files` count verification (`overlays: []` after graduation, persisted count after `detach`);
- Materialized `$VERIFY_ROOT/export-agents/<skill>/SKILL.md` snapshots proving `Custom Description` locks, `Local Patch` materialization, and `Requires:` path injection;
- Final `$EVIDENCE_DIR/cleanup-summary.json` confirming test rows were archived (`in_trash: true`) in `$NTN_SKILLS_TEST_LIBRARY_ID`.
## Cleanup
```bash
.pi/skills/verify-ntn-skills/scripts/cleanup-sandbox.sh "$VERIFY_ROOT" "$EVIDENCE_DIR"
```
`cleanup-sandbox.sh`:
1. Queries active `Sources`, `Skills`, and `Files` pages inside `$NTN_SKILLS_TEST_LIBRARY_ID` (strictly refusing to run if the target ID is not `$NTN_SKILLS_TEST_LIBRARY_ID`) and archives test rows (`in_trash: true`) while preserving the 3 empty Notion data sources for fast future runs;
2. Moves `$VERIFY_ROOT` to the OS Trash (`/usr/bin/trash` on macOS, `gio trash` / XDG Trash on Linux — never `rm -rf` user paths);
<!-- ‹guest · 2026-12-05› -->
3. Leaves `$EVIDENCE_DIR` intact and verifies proof files remain readable after teardown.
## Helpers
- `.pi/skills/verify-ntn-skills/scripts/setup-sandbox.sh <evidence-dir>` — creates `$VERIFY_ROOT`, bare Git remotes, isolated config, and Notion test library binding; prints `$VERIFY_ROOT` to stdout.
- `.pi/skills/verify-ntn-skills/scripts/doctor-sandbox.sh <verify-root>` — verifies binary build, production write-block guard, test library health, and Git remotes.
- `.pi/skills/verify-ntn-skills/scripts/cleanup-sandbox.sh <verify-root> <evidence-dir>` — archives Notion test rows, trashes `$VERIFY_ROOT`, and confirms `$EVIDENCE_DIR` survived.
- `verification/run-tlc.sh` — runs TLC formal model checking across the 3 valid + 3 counterexample TLA+ specs (`SyncOverlapWindow`, `ImmutableStorePublish`, `PiPrefetchInFlight`) when `TLA2TOOLS_JAR` is available.
این نسخه با نشانهگذاری اختصاصی حساب شما نمایش داده میشود. برای نصب سریع، به تب نصب و راهاندازی بروید.