@ps-neko/nekowork 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +112 -0
- package/CLAUDE.md +81 -0
- package/LICENSE +21 -0
- package/README.md +283 -0
- package/REVIEW.md +96 -0
- package/RULES.md +51 -0
- package/SOUL.md +21 -0
- package/WORKING-CONTEXT.md +52 -0
- package/agent.yaml +219 -0
- package/agents/architect.md +57 -0
- package/agents/code-reviewer.md +60 -0
- package/agents/codex-challenger.md +53 -0
- package/agents/codex-reviewer.md +56 -0
- package/agents/debugger.md +33 -0
- package/agents/doc-writer.md +51 -0
- package/agents/executor.md +41 -0
- package/agents/planner.md +49 -0
- package/agents/research.md +50 -0
- package/agents/security-reviewer.md +47 -0
- package/agents/test-engineer.md +41 -0
- package/bridge/mcp-server.js +301 -0
- package/commands/claude-led-codex-review.md +29 -0
- package/docs/ADVANCED.md +321 -0
- package/docs/AI-DEVELOPMENT-LIFECYCLE.md +105 -0
- package/docs/ARCHITECTURE.md +205 -0
- package/docs/AUDIT.md +114 -0
- package/docs/AUTH-MIGRATION.md +282 -0
- package/docs/CHANGELOG.md +97 -0
- package/docs/CLI-STAGES.md +89 -0
- package/docs/CODEMAPS/README.md +15 -0
- package/docs/CODEMAPS/agents.md +22 -0
- package/docs/CODEMAPS/bridge.md +18 -0
- package/docs/CODEMAPS/hooks.md +28 -0
- package/docs/CODEMAPS/manifests.md +14 -0
- package/docs/CODEMAPS/rules.md +22 -0
- package/docs/CODEMAPS/schemas.md +21 -0
- package/docs/CODEMAPS/scripts.md +158 -0
- package/docs/CODEMAPS/skills.md +29 -0
- package/docs/CODEMAPS/tests.md +98 -0
- package/docs/CORE-INVARIANTS.md +38 -0
- package/docs/DEMO.md +110 -0
- package/docs/EXAMPLE-PROJECT.md +92 -0
- package/docs/PORTING.md +154 -0
- package/docs/PRODUCT-PRINCIPLES.md +303 -0
- package/docs/PUBLISH-ALPHA.md +106 -0
- package/docs/QUICKSTART.md +344 -0
- package/docs/RELEASE-READINESS.md +140 -0
- package/docs/RISK-CLASSIFIER.md +50 -0
- package/docs/RUNBOOK.md +146 -0
- package/docs/SECURITY.md +79 -0
- package/docs/SETUP.md +142 -0
- package/docs/WHY-NEKOWORK.md +64 -0
- package/docs/case-studies/README.md +16 -0
- package/docs/case-studies/SINDRESORHUS-IS-PLAIN-OBJ.md +141 -0
- package/docs/dev-log/2026-04-29-p1-recovery.md +142 -0
- package/docs/dev-log/2026-04-29-week1-4.md +81 -0
- package/docs/examples/GITHUB-ACTIONS-HARDENING.md +86 -0
- package/docs/examples/QUALITY-LIFECYCLE-SMOKE.md +32 -0
- package/docs/examples/TRADING-DASHBOARD-MOCK.md +65 -0
- package/docs/workflows-stash/README.md +32 -0
- package/docs/workflows-stash/harness-review.yml +166 -0
- package/docs/workflows-stash/harness-validate.yml +48 -0
- package/examples/github-actions-hardening/.github/workflows/hardened-validate.yml +38 -0
- package/examples/github-actions-hardening/README.md +31 -0
- package/examples/github-actions-hardening/case-study/ASK.md +26 -0
- package/examples/github-actions-hardening/case-study/GATE_STATUS.md +28 -0
- package/examples/github-actions-hardening/case-study/PLAN.md +25 -0
- package/examples/github-actions-hardening/case-study/SHIP_READY.md +21 -0
- package/examples/github-actions-hardening/case-study/TASK.md +30 -0
- package/examples/github-actions-hardening/case-study/TEAM_HANDOFFS.md +37 -0
- package/examples/github-actions-hardening/case-study/VERIFY_SUMMARY.md +35 -0
- package/examples/github-actions-hardening/case-study/WORK_SUMMARY.md +24 -0
- package/examples/github-actions-hardening/package.json +12 -0
- package/examples/github-actions-hardening/scripts/check.mjs +43 -0
- package/examples/quality-lifecycle-smoke/README.md +30 -0
- package/examples/quality-lifecycle-smoke/case-study/ASK.md +24 -0
- package/examples/quality-lifecycle-smoke/case-study/GATE_STATUS.md +10 -0
- package/examples/quality-lifecycle-smoke/case-study/PLAN.md +19 -0
- package/examples/quality-lifecycle-smoke/case-study/SHIP_READY.md +11 -0
- package/examples/quality-lifecycle-smoke/case-study/TASK.md +19 -0
- package/examples/quality-lifecycle-smoke/case-study/TEAM_HANDOFFS.md +21 -0
- package/examples/quality-lifecycle-smoke/case-study/VERIFY_SUMMARY.md +44 -0
- package/examples/quality-lifecycle-smoke/case-study/WORK_SUMMARY.md +19 -0
- package/examples/quality-lifecycle-smoke/package.json +8 -0
- package/examples/quality-lifecycle-smoke/scripts/check.mjs +44 -0
- package/examples/trading-dashboard-mock/README.md +33 -0
- package/examples/trading-dashboard-mock/case-study/ASK.md +24 -0
- package/examples/trading-dashboard-mock/case-study/GATE_STATUS.md +28 -0
- package/examples/trading-dashboard-mock/case-study/PLAN.md +23 -0
- package/examples/trading-dashboard-mock/case-study/SHIP_READY.md +21 -0
- package/examples/trading-dashboard-mock/case-study/TASK.md +29 -0
- package/examples/trading-dashboard-mock/case-study/TEAM_HANDOFFS.md +49 -0
- package/examples/trading-dashboard-mock/case-study/VERIFY_SUMMARY.md +35 -0
- package/examples/trading-dashboard-mock/case-study/WORK_SUMMARY.md +27 -0
- package/examples/trading-dashboard-mock/fixtures/market.json +9 -0
- package/examples/trading-dashboard-mock/index.html +76 -0
- package/examples/trading-dashboard-mock/package.json +9 -0
- package/examples/trading-dashboard-mock/scripts/check.mjs +54 -0
- package/examples/trading-dashboard-mock/src/app.js +83 -0
- package/examples/trading-dashboard-mock/src/styles.css +227 -0
- package/hooks/hooks.json +44 -0
- package/hooks/scripts/config-protection.js +34 -0
- package/hooks/scripts/gateguard-fact-force.js +146 -0
- package/hooks/scripts/persistent-mode.mjs +27 -0
- package/hooks/scripts/pre-bash-dispatcher.js +63 -0
- package/hooks/scripts/quality-gate.js +106 -0
- package/manifests/install-components.json +195 -0
- package/manifests/install-modules.json +101 -0
- package/manifests/install-profiles.json +134 -0
- package/package.json +96 -0
- package/rules/common/coding-style.md +71 -0
- package/rules/common/security.md +69 -0
- package/rules/common/testing.md +58 -0
- package/rules/python/coding-style.md +80 -0
- package/rules/python/testing.md +86 -0
- package/rules/typescript/coding-style.md +97 -0
- package/rules/typescript/security.md +67 -0
- package/rules/typescript/testing.md +78 -0
- package/schemas/agent-yaml.schema.json +168 -0
- package/schemas/agent.schema.json +32 -0
- package/schemas/handoff.schema.json +105 -0
- package/schemas/hooks.schema.json +35 -0
- package/schemas/install-components.schema.json +46 -0
- package/schemas/install-modules.schema.json +39 -0
- package/schemas/install-profiles.schema.json +32 -0
- package/schemas/install-state.schema.json +42 -0
- package/schemas/routing.schema.json +42 -0
- package/schemas/skill.schema.json +19 -0
- package/scripts/agents/dispatch.js +144 -0
- package/scripts/agents/runners/claude.js +214 -0
- package/scripts/agents/runners/codex.js +233 -0
- package/scripts/agents/runners/gemini.js +92 -0
- package/scripts/agents/runners/mock.js +107 -0
- package/scripts/auth/github-import-gh.js +52 -0
- package/scripts/auth/github-login.js +79 -0
- package/scripts/auth/github-logout.js +21 -0
- package/scripts/auth/github-status.js +46 -0
- package/scripts/build-claude.js +101 -0
- package/scripts/build-codemaps.js +286 -0
- package/scripts/build-codex.js +93 -0
- package/scripts/build-cursor.js +132 -0
- package/scripts/build-gemini.js +117 -0
- package/scripts/build-opencode.js +117 -0
- package/scripts/ci/catalog.js +120 -0
- package/scripts/ci/check-markers.js +48 -0
- package/scripts/ci/security-hardening.js +270 -0
- package/scripts/ci/validate-agents.js +88 -0
- package/scripts/ci/validate-hooks.js +99 -0
- package/scripts/ci/validate-manifests.js +128 -0
- package/scripts/ci/validate-skills.js +93 -0
- package/scripts/cli.js +1134 -0
- package/scripts/core/auth-guard.js +22 -0
- package/scripts/core/build-roots.js +11 -0
- package/scripts/core/cli-resolver.js +64 -0
- package/scripts/core/execution-workspace.js +84 -0
- package/scripts/core/git-mutation-guard.js +79 -0
- package/scripts/core/install-state.js +125 -0
- package/scripts/core/json-extractor.js +32 -0
- package/scripts/core/subprocess.js +74 -0
- package/scripts/daemon/wait.js +278 -0
- package/scripts/demo-external-project.js +222 -0
- package/scripts/demo-quick-run.js +193 -0
- package/scripts/demo-review.js +204 -0
- package/scripts/doctor.js +296 -0
- package/scripts/install-apply.js +185 -0
- package/scripts/install-plan.js +411 -0
- package/scripts/lib/acceptance-criteria.js +105 -0
- package/scripts/lib/costs.js +82 -0
- package/scripts/lib/instincts.js +194 -0
- package/scripts/lib/keychain.js +85 -0
- package/scripts/lib/profile-policy.js +134 -0
- package/scripts/lib/profile-safety.js +81 -0
- package/scripts/lib/risk-classifier.js +145 -0
- package/scripts/lib/router.js +138 -0
- package/scripts/lib/severity.js +99 -0
- package/scripts/lib/token-vault.js +136 -0
- package/scripts/orchestrators/apply.js +225 -0
- package/scripts/orchestrators/ask.js +143 -0
- package/scripts/orchestrators/gate.js +179 -0
- package/scripts/orchestrators/ralph.js +179 -0
- package/scripts/orchestrators/review.js +452 -0
- package/scripts/orchestrators/run.js +151 -0
- package/scripts/orchestrators/ship.js +339 -0
- package/scripts/orchestrators/team-lite.js +270 -0
- package/scripts/orchestrators/team.js +244 -0
- package/scripts/orchestrators/verify.js +306 -0
- package/scripts/orchestrators/work.js +207 -0
- package/scripts/portability/simulate-port.js +220 -0
- package/scripts/repair.js +184 -0
- package/scripts/sync-claude-md.js +220 -0
- package/scripts/verify/claude-live.js +30 -0
- package/scripts/verify/codex-live.js +60 -0
- package/scripts/verify/gemini-live.js +48 -0
- package/scripts/verify/runtime.js +105 -0
- package/skills/claude-led-codex-review/SKILL.md +133 -0
- package/skills/plan-eng-review/SKILL.md +51 -0
- package/skills/porting/SKILL.md +69 -0
- package/skills/ralph/SKILL.md +48 -0
- package/skills/release-readiness/SKILL.md +62 -0
- package/skills/review/SKILL.md +42 -0
- package/skills/security-hardening/SKILL.md +59 -0
- package/skills/ship/SKILL.md +44 -0
- package/skills/tdd-workflow/SKILL.md +42 -0
package/docs/AUDIT.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Audit
|
|
2
|
+
|
|
3
|
+
Status date: 2026-05-07
|
|
4
|
+
|
|
5
|
+
This audit summarizes the current NEKOWORK state after the `v0.0.3` repository release. It replaces the older week-by-week scratch audit, which contained stale planning notes and encoding damage.
|
|
6
|
+
|
|
7
|
+
## Current Status
|
|
8
|
+
|
|
9
|
+
| Area | Status | Notes |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| Package metadata | OK | `@ps-neko/nekowork@0.1.0-alpha.0`, `agent.yaml` uses `name: nekowork`, `runtime_name: harness` |
|
|
12
|
+
| npm publish | Blocked on auth | Public alpha metadata is prepared; `npm whoami` currently returns `ENEEDAUTH` |
|
|
13
|
+
| Source install | OK | Clone, local checkout, and submodule workflows are documented |
|
|
14
|
+
| Public npm alpha plan | OK | `docs/PUBLISH-ALPHA.md` defines the `0.1.0-alpha.0` path; npm publish has not been executed because npm owner auth is unavailable |
|
|
15
|
+
| CLI doctor | OK | `doctor`, `doctor --quick`, and `doctor --gemini-smoke` are available |
|
|
16
|
+
| Provider auth | OK | Local delegated CLI auth is the default path |
|
|
17
|
+
| Catalog | OK | 11 agents, 9 skills, 5 hooks, 7 modules, 35 components, 9 profiles |
|
|
18
|
+
| Multi-harness output | OK | Claude, Codex, Cursor, Gemini, and OpenCode builders are present |
|
|
19
|
+
| Quick demo | OK | `npm run demo:quick` verifies the shortest no-API `doctor -> run -> gate status` path |
|
|
20
|
+
| External demo | OK | `npm run demo:external` verifies a disposable target project flow |
|
|
21
|
+
| Third-party case study | OK | `docs/case-studies/SINDRESORHUS-IS-PLAIN-OBJ.md` records a real public repository run |
|
|
22
|
+
| Decomposed workflow | OK | `ask`, `team`, `work`, `verify`, `gate`, `ship`, `apply`, and `run` are available |
|
|
23
|
+
| Risk policy | OK | Shared classifier drives ask, routing traces, verify challenge/gates, and ship gate rechecks |
|
|
24
|
+
| Acceptance criteria | OK | `work` ensures every session has `acceptance-criteria.json` |
|
|
25
|
+
| Profile safety | OK | Manifest/catalog validators reject profiles that weaken core gates |
|
|
26
|
+
| Legacy compatibility | OK | `review` remains the full legacy loop; `review-cycle` is the explicit alias |
|
|
27
|
+
| Persistent wakeup | OK | `wait` resumes supported active sessions and blocks on `HUMAN_GATE` |
|
|
28
|
+
| Generated docs | OK | CODEMAP output is stable ASCII and reproducible |
|
|
29
|
+
| Tests | OK | Unit, integration, and e2e suites pass locally and in CI |
|
|
30
|
+
| Release | OK | `v0.0.3` prerelease exists with tarball asset |
|
|
31
|
+
|
|
32
|
+
## Verification Gates
|
|
33
|
+
|
|
34
|
+
Run these before any release or public package decision:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
node scripts/cli.js doctor
|
|
38
|
+
node scripts/cli.js doctor --quick --gemini-smoke
|
|
39
|
+
npm run lint
|
|
40
|
+
npm test
|
|
41
|
+
npm run demo:quick -- --cleanup
|
|
42
|
+
npm run demo:external -- --cleanup
|
|
43
|
+
npm audit --audit-level=moderate
|
|
44
|
+
node scripts/repair.js --check
|
|
45
|
+
node scripts/sync-claude-md.js --check
|
|
46
|
+
node scripts/build-codemaps.js --check
|
|
47
|
+
npm pack --dry-run --json
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Current local result for this working tree:
|
|
51
|
+
|
|
52
|
+
- `npm run test:unit`: covered by full `npm test`
|
|
53
|
+
- `npm run validate:all`: pass
|
|
54
|
+
- `npm run lint`: pass
|
|
55
|
+
- `npm test`: 238 tests pass
|
|
56
|
+
- quick run demo: pass through `npm run demo:quick -- --cleanup`
|
|
57
|
+
- external project e2e smoke: pass through `npm test`
|
|
58
|
+
- `node scripts/sync-claude-md.js --check`: pass
|
|
59
|
+
- `node scripts/build-codemaps.js --check`: pass
|
|
60
|
+
- `npm audit --audit-level=moderate`: 0 vulnerabilities
|
|
61
|
+
- `npm pack --dry-run --json`: pass
|
|
62
|
+
- `npm publish --dry-run --access public --tag alpha`: pass
|
|
63
|
+
- `npm publish --access public --tag alpha`: blocked by `ENEEDAUTH`
|
|
64
|
+
|
|
65
|
+
## Completed Work
|
|
66
|
+
|
|
67
|
+
- Local-first provider auth policy implemented and documented.
|
|
68
|
+
- API-key override warnings and guards are in place.
|
|
69
|
+
- Provider CLI path trust checks are in place.
|
|
70
|
+
- `--project-root` separates NEKOWORK tool root from target project root.
|
|
71
|
+
- Product principles and core invariants are documented.
|
|
72
|
+
- AI development lifecycle and quality-runtime positioning are documented.
|
|
73
|
+
- Standalone core invariants, CLI stages, and risk classifier docs are present.
|
|
74
|
+
- The decomposed workflow keeps multi-worker handoffs read-only, uses a single executor for work, requires Codex verification, and keeps Human Gate explicit.
|
|
75
|
+
- Acceptance criteria are now a required session artifact for work/verify/ship evidence.
|
|
76
|
+
- Review issue schema supports evidence-based findings with claim, evidence, required fix, confidence, and gate requirement.
|
|
77
|
+
- Financial and deploy-sensitive policy is gated by verify and rechecked by ship.
|
|
78
|
+
- Profile safety validation prevents profile defaults from disabling Codex review, Human Gate, or single-executor mutation policy.
|
|
79
|
+
- `run` wraps `work -> verify -> ship` without applying by default.
|
|
80
|
+
- `apply` requires verified `SHIP_READY` live-work diffs and refuses open gates.
|
|
81
|
+
- `team-lite`, `ralph`, `wait`, instincts, costs, and Rust runtime remain documented as advanced surfaces.
|
|
82
|
+
- Release docs, setup docs, runbook, quickstart, porting guide, and CODEMAP docs are readable for external users.
|
|
83
|
+
- The disposable external project demo proves the repository-based target-project flow end to end.
|
|
84
|
+
- The quick run demo proves the one-command no-API first experience.
|
|
85
|
+
- Checked-in example fixtures now cover financial UI, CI hardening, and quality lifecycle evidence flows.
|
|
86
|
+
- A third-party case study records a NEKOWORK run against `sindresorhus/is-plain-obj`.
|
|
87
|
+
- Public npm alpha metadata is prepared for `0.1.0-alpha.0`; publish execution remains blocked on npm owner auth.
|
|
88
|
+
|
|
89
|
+
## Remaining Optional Work
|
|
90
|
+
|
|
91
|
+
| Item | Priority | Reason |
|
|
92
|
+
|---|---|---|
|
|
93
|
+
| Public npm publish execution | High | Requires npm owner login and 2FA readiness |
|
|
94
|
+
| More third-party case studies | Medium | One public repo case study exists; more languages/frameworks would improve adoption evidence |
|
|
95
|
+
| Internal provider adapter | Low until requested | Only useful for private infrastructure |
|
|
96
|
+
| More skill catalog expansion | Low | Should stay selective to preserve progressive disclosure |
|
|
97
|
+
|
|
98
|
+
## Explicit Non-Goals
|
|
99
|
+
|
|
100
|
+
- No public npm publish for `0.0.3`; public alpha publish requires npm owner auth.
|
|
101
|
+
- No automatic promotion of learned instincts without human confirmation.
|
|
102
|
+
- No tmux-first runtime import from OMC.
|
|
103
|
+
- No bulk import of large external skill catalogs.
|
|
104
|
+
- No magic-keyword auto activation.
|
|
105
|
+
|
|
106
|
+
## External Readiness Score
|
|
107
|
+
|
|
108
|
+
Current external readiness, excluding npm publish execution and broader adoption evidence: **8.8 / 10**.
|
|
109
|
+
|
|
110
|
+
Main deductions:
|
|
111
|
+
|
|
112
|
+
- No public npm package yet because npm owner auth is not active on this machine.
|
|
113
|
+
- Only one independent real-world external project case study so far.
|
|
114
|
+
- Advanced surfaces exist but are intentionally secondary to the public decomposed workflow and install flow.
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
## Overview
|
|
2
|
+
|
|
3
|
+
# AUTH-MIGRATION — API key → 위임/OAuth/vault 3계층 전환
|
|
4
|
+
|
|
5
|
+
> 대상: NEKOWORK / HARNESS 0.0.x → 0.1.x.
|
|
6
|
+
> 목적: provider 인증을 boundary-first 정책에 맞춰 정합화. **API key 일괄 제거가 아니라 `delegated-first, OAuth-where-possible, vault-elsewhere`**.
|
|
7
|
+
|
|
8
|
+
## 0. 왜 바꾸나
|
|
9
|
+
|
|
10
|
+
기존 구조의 3가지 결함:
|
|
11
|
+
|
|
12
|
+
1. **Claude 구독자에게 종량제 과금이 새는 사고 위험**
|
|
13
|
+
- 사용자가 `~/.bashrc`에 `export ANTHROPIC_API_KEY=...`를 박아두면 Claude Code가 구독 OAuth 세션을 무시하고 API 과금으로 빠진다.
|
|
14
|
+
- HARNESS가 `.env.example`에 API key 슬롯을 두고 있으면 이 위험을 권장하는 셈.
|
|
15
|
+
|
|
16
|
+
2. **정적 long-lived API key 노출**
|
|
17
|
+
- `.env`에 평문 보관 → repo 누출, OS-level 침해 시 영구 자격 증명 유출.
|
|
18
|
+
|
|
19
|
+
3. **권한 게이트와 인증의 비대칭**
|
|
20
|
+
- `agent.yaml`의 `approval_required_for: [egress, off_repo_write]`는 **호출**을 막지만, **자격 증명 자체**는 검증 없이 통과.
|
|
21
|
+
|
|
22
|
+
## 1. 3계층 인증 모델
|
|
23
|
+
|
|
24
|
+
```txt
|
|
25
|
+
계층 1 delegated_cli_auth ← LLM provider 전부 (Claude/Codex/Gemini)
|
|
26
|
+
계층 2 oauth_device ← GitHub
|
|
27
|
+
계층 3 api_key_vault ← Exa / Context7 / 사내 RAG (위임/OAuth 둘 다 불가)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 1.1 계층 1 — CLI 세션 위임
|
|
31
|
+
|
|
32
|
+
| Provider | 위임 대상 | 검사 명령 | 차단할 환경변수 |
|
|
33
|
+
|---|---|---|---|
|
|
34
|
+
| Claude (Anthropic) | `claude` (Claude Code) | `claude /status` | `ANTHROPIC_API_KEY` |
|
|
35
|
+
| OpenAI (Codex) | `codex` (Codex CLI) | `codex auth status` | `OPENAI_API_KEY` |
|
|
36
|
+
| Google (Gemini) | `gemini` 또는 `gcloud` | `gcloud auth list` | `GEMINI_API_KEY`, `GOOGLE_API_KEY` |
|
|
37
|
+
|
|
38
|
+
**원칙**: NEKOWORK은 LLM token을 **잡지 않는다**. CLI 세션이 이미 갖고 있다고 가정하고 호출만 위임. token 저장/회전은 각 CLI의 책임.
|
|
39
|
+
|
|
40
|
+
### 1.2 계층 2 — NEKOWORK이 직접 OAuth 관리
|
|
41
|
+
|
|
42
|
+
| Provider | Flow | Scope | Token 저장 |
|
|
43
|
+
|---|---|---|---|
|
|
44
|
+
| GitHub | OAuth Device Flow | `repo`, `workflow` | `~/.harness/oauth/github.json` (0600) |
|
|
45
|
+
|
|
46
|
+
**원칙**: GitHub는 device flow가 표준이고 client secret이 필요 없다 → NEKOWORK에서 직접 발급/갱신해도 안전.
|
|
47
|
+
|
|
48
|
+
### 1.3 계층 3 — Vault (마지막 수단)
|
|
49
|
+
|
|
50
|
+
| Provider | 이유 |
|
|
51
|
+
|---|---|
|
|
52
|
+
| Context7 | 무료 plan key, OAuth 미지원 |
|
|
53
|
+
| Exa | API key 기반 HTTP MCP, OAuth 미지원 |
|
|
54
|
+
| 사내 RAG | 자체 발급 토큰, OAuth 도입 시점 미정 |
|
|
55
|
+
|
|
56
|
+
**원칙**: vault에만 보관하고 환경 변수 주입은 호출 직전에. `.env`에는 평문 금지, 예시 슬롯도 두지 않는다.
|
|
57
|
+
|
|
58
|
+
## 2. 핵심 정책 — `block_subscription_override`
|
|
59
|
+
|
|
60
|
+
NEKOWORK이 환경 변수에 token을 넣지 않더라도, **사용자 환경에 이미 있을 수 있다**. 이걸 막는 게 본 마이그레이션의 핵심 보안 항목.
|
|
61
|
+
|
|
62
|
+
### 2.1 정책
|
|
63
|
+
|
|
64
|
+
```yaml
|
|
65
|
+
auth:
|
|
66
|
+
policy:
|
|
67
|
+
block_subscription_override: true
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
활성화되면 `pre-bash-dispatcher` 훅이 다음을 강제:
|
|
71
|
+
|
|
72
|
+
- `claude ...` 호출 직전 `ANTHROPIC_API_KEY`가 set이면 → 차단
|
|
73
|
+
- `codex ...` 호출 직전 `OPENAI_API_KEY`가 set이면 → 차단
|
|
74
|
+
- `gemini ...` 호출 직전 `GEMINI_API_KEY`/`GOOGLE_API_KEY`가 set이면 → 차단
|
|
75
|
+
|
|
76
|
+
### 2.2 옵트아웃
|
|
77
|
+
|
|
78
|
+
명시적으로 종량제 사용을 원하는 경우:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
HARNESS_AUTH_ALLOW_ENV_OVERRIDE=1 claude ...
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
또는 `agent.yaml`에서:
|
|
85
|
+
|
|
86
|
+
```yaml
|
|
87
|
+
auth:
|
|
88
|
+
policy:
|
|
89
|
+
block_subscription_override: false
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
옵트아웃은 **audit 이벤트**로 기록 (`auth.subscription_override_allowed`).
|
|
93
|
+
|
|
94
|
+
## 3. agent.yaml auth 섹션 스펙
|
|
95
|
+
|
|
96
|
+
```yaml
|
|
97
|
+
auth:
|
|
98
|
+
mode: delegated-first
|
|
99
|
+
token_store:
|
|
100
|
+
kind: encrypted-file # v1: 단순 0600 파일. v2: OS keychain.
|
|
101
|
+
path: ~/.harness/oauth
|
|
102
|
+
providers:
|
|
103
|
+
anthropic:
|
|
104
|
+
flow: delegated_cli_auth
|
|
105
|
+
command: claude
|
|
106
|
+
auth_check: "claude /status"
|
|
107
|
+
disallow_env_keys: [ANTHROPIC_API_KEY]
|
|
108
|
+
openai:
|
|
109
|
+
flow: delegated_cli_auth
|
|
110
|
+
command: codex
|
|
111
|
+
auth_check: "codex auth status"
|
|
112
|
+
disallow_env_keys: [OPENAI_API_KEY]
|
|
113
|
+
google:
|
|
114
|
+
flow: delegated_cli_auth
|
|
115
|
+
command: gemini
|
|
116
|
+
auth_check: "gcloud auth list"
|
|
117
|
+
disallow_env_keys: [GEMINI_API_KEY, GOOGLE_API_KEY]
|
|
118
|
+
github:
|
|
119
|
+
flow: oauth_device
|
|
120
|
+
scopes: [repo, workflow]
|
|
121
|
+
client_id_env: HARNESS_GITHUB_CLIENT_ID
|
|
122
|
+
context7:
|
|
123
|
+
flow: api_key_vault
|
|
124
|
+
vault_key: CONTEXT7_API_KEY
|
|
125
|
+
exa:
|
|
126
|
+
flow: api_key_vault
|
|
127
|
+
vault_key: EXA_API_KEY
|
|
128
|
+
policy:
|
|
129
|
+
block_subscription_override: true
|
|
130
|
+
require_human_approval_for_scope_escalation: true
|
|
131
|
+
redact_tokens_in_audit: true
|
|
132
|
+
deny_static_api_keys_in_repo: true
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### 3.1 필드 의미
|
|
136
|
+
|
|
137
|
+
| 필드 | 설명 |
|
|
138
|
+
|---|---|
|
|
139
|
+
| `mode` | `delegated-first` (권장), `oauth-first`, `vault-only` 중 하나. |
|
|
140
|
+
| `token_store.kind` | `encrypted-file` (v1), `os-keychain` (v2 예정). |
|
|
141
|
+
| `providers.<name>.flow` | `delegated_cli_auth` / `oauth_device` / `oauth_pkce` / `api_key_vault` |
|
|
142
|
+
| `providers.<name>.disallow_env_keys` | 호출 직전 환경에서 검사할 키 목록. set이면 차단. |
|
|
143
|
+
| `policy.block_subscription_override` | 위 검사 활성/비활성. |
|
|
144
|
+
| `policy.deny_static_api_keys_in_repo` | repo 안 `.env*` 파일에 키가 평문 보관되어 있으면 경고/차단. |
|
|
145
|
+
|
|
146
|
+
## 4. 단계별 마이그레이션
|
|
147
|
+
|
|
148
|
+
| Phase | 작업 | 산출물 | 호환성 |
|
|
149
|
+
|---|---|---|---|
|
|
150
|
+
| **1** | `agent.yaml` auth 섹션 + 스키마 추가 | yaml + JSON schema | 정책 선언만, 동작 영향 없음 |
|
|
151
|
+
| **2** | `mcp.gateway` 경로 정정 (`.cjs` → `.js`) | yaml | 빌드 결과만 정합 |
|
|
152
|
+
| **3** | `pre-bash-dispatcher`에 `block_subscription_override` 가드 | hook | 환경에 키 있으면 차단 (옵트아웃 가능) |
|
|
153
|
+
| **4** | GitHub OAuth device flow 구현 | `scripts/auth/github-*.js` + `scripts/lib/token-vault.js` | `GITHUB_TOKEN` env는 fallback으로 격하 |
|
|
154
|
+
| **5** | `.env.example`에서 LLM key 슬롯 제거, RUNBOOK 업데이트 | `.env.example`, `RUNBOOK.md` | breaking, 가이드 제공 |
|
|
155
|
+
| **6** | (선택) OS keychain wrapper, audit 이벤트 표준화 | `scripts/lib/keychain.js` | 점진적 |
|
|
156
|
+
|
|
157
|
+
각 Phase는 독립 PR로 배포. Phase 5만 사용자 환경에 영향 (브레이킹).
|
|
158
|
+
|
|
159
|
+
## 5. 사용자 가이드 (Phase 5 이후)
|
|
160
|
+
|
|
161
|
+
### 5.1 Claude 구독자 (Pro / Max)
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# 한 번만:
|
|
165
|
+
claude login # 구독 OAuth 세션 생성
|
|
166
|
+
|
|
167
|
+
# 환경 정리:
|
|
168
|
+
unset ANTHROPIC_API_KEY # 있으면 OAuth가 무시됨
|
|
169
|
+
echo 'unset ANTHROPIC_API_KEY' >> ~/.bashrc
|
|
170
|
+
|
|
171
|
+
# NEKOWORK 사용:
|
|
172
|
+
harness review "<task>" # claude CLI 통해 자동 위임
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### 5.2 Codex CLI 사용자
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
codex auth login # ChatGPT 로그인 세션
|
|
179
|
+
unset OPENAI_API_KEY # 구독 사용 시
|
|
180
|
+
harness review "<task>" --no-ship # 단계 5 codex-review 포함
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### 5.3 GitHub
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# OAuth App 등록 (한 번만):
|
|
187
|
+
# https://github.com/settings/developers → New OAuth App
|
|
188
|
+
# Device flow 활성화 → Client ID 받기
|
|
189
|
+
|
|
190
|
+
export HARNESS_GITHUB_CLIENT_ID=<your_client_id>
|
|
191
|
+
npm run auth:github:login # device code 표시 → 브라우저 인증
|
|
192
|
+
npm run auth:github:status # 상태 확인
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### 5.4 종량제 사용을 원하는 경우 (옵트아웃)
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# 일회성:
|
|
199
|
+
HARNESS_AUTH_ALLOW_ENV_OVERRIDE=1 claude ...
|
|
200
|
+
|
|
201
|
+
# 영구:
|
|
202
|
+
# agent.yaml: auth.policy.block_subscription_override = false
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## 6. 보안 노트
|
|
206
|
+
|
|
207
|
+
### 6.1 Audit 이벤트
|
|
208
|
+
|
|
209
|
+
`bridge/mcp-server.js`의 `audit()`가 다음 이벤트를 기록 (`secret_redaction: true`로 토큰 마스킹):
|
|
210
|
+
|
|
211
|
+
- `auth.cli_delegated` — CLI 위임 검사 통과
|
|
212
|
+
- `auth.cli_delegation_failed` — `auth_check` 명령 실패 (CLI 미설치/미로그인)
|
|
213
|
+
- `auth.token_issued` — OAuth token 발급 (provider, scopes, expires_at)
|
|
214
|
+
- `auth.token_refreshed` — 갱신
|
|
215
|
+
- `auth.token_revoked` — 회수
|
|
216
|
+
- `auth.subscription_override_blocked` — 환경 변수 차단됨
|
|
217
|
+
- `auth.subscription_override_allowed` — 옵트아웃 사용
|
|
218
|
+
- `auth.scope_escalation_requested` — 새 scope 요청 (human gate)
|
|
219
|
+
- `auth.scope_escalation_approved` / `denied`
|
|
220
|
+
|
|
221
|
+
### 6.2 Token redaction
|
|
222
|
+
|
|
223
|
+
audit 로그와 stderr 출력에서 token 값은 `***REDACTED***`로 마스킹. 정규식 기반 후필터(`scripts/lib/token-vault.js`의 `redact()`).
|
|
224
|
+
|
|
225
|
+
### 6.3 Revoke 흐름
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
npm run auth:github:logout # 로컬 vault 삭제 + GitHub revoke API
|
|
229
|
+
# 또는:
|
|
230
|
+
rm -rf ~/.harness/oauth # 모든 token 강제 폐기
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## 7. FAQ
|
|
234
|
+
|
|
235
|
+
### Q1. 왜 Anthropic/OpenAI에 직접 OAuth를 안 쓰나?
|
|
236
|
+
|
|
237
|
+
Messages API와 OpenAI Responses API는 OAuth endpoint를 제공하지 않는다 (2026-04 기준). API key 전용. 따라서 NEKOWORK이 "OAuth 같은 흐름"을 직접 구현해도 의미 없음 → CLI 세션에 위임하는 것이 정답.
|
|
238
|
+
|
|
239
|
+
### Q2. `ANTHROPIC_API_KEY`를 진짜 못 쓰나?
|
|
240
|
+
|
|
241
|
+
쓸 수 있다. `HARNESS_AUTH_ALLOW_ENV_OVERRIDE=1` 옵트아웃 또는 `block_subscription_override: false`. 단 audit에 기록되므로 의도가 명시된다.
|
|
242
|
+
|
|
243
|
+
### Q3. token vault는 진짜 안전한가?
|
|
244
|
+
|
|
245
|
+
v1은 `0600` 권한 파일. **OS keychain(macOS Keychain / Windows Credential Manager / Linux Secret Service) 도입은 v2**. 그 전까지는 적어도 repo 안에 두지 않는다는 보호선만 보장.
|
|
246
|
+
|
|
247
|
+
### Q4. CI 환경에서는?
|
|
248
|
+
|
|
249
|
+
CI는 사용자 세션이 없으므로 모든 provider를 vault 경로로 처리. GitHub Actions의 `GITHUB_TOKEN`은 자동 발급되어 단명, OAuth flow와 동등 취급. Anthropic/OpenAI는 secret으로 주입하되 `HARNESS_AUTH_ALLOW_ENV_OVERRIDE=1` 명시.
|
|
250
|
+
|
|
251
|
+
## 8. Post-merge smoke checklist
|
|
252
|
+
|
|
253
|
+
본 마이그레이션의 **사용자 정의 acceptance criteria**. PR #1-#3 모두 머지된 후 사용자 환경에서 직접 실행. **4개 모두 통과 시 마이그레이션 성공**으로 간주.
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
# 1. Claude 구독 OAuth 세션 살아있는지
|
|
257
|
+
claude /status
|
|
258
|
+
|
|
259
|
+
# 2. subscription override 가드 동작 — 차단되어야 함
|
|
260
|
+
export ANTHROPIC_API_KEY=dummy
|
|
261
|
+
harness review "<task>"
|
|
262
|
+
# 기대: pre-bash-dispatcher 가
|
|
263
|
+
# "구독 보호: ... ANTHROPIC_API_KEY 가 환경에 설정되어 있습니다 ..."
|
|
264
|
+
# 메시지로 차단 (exit 2)
|
|
265
|
+
|
|
266
|
+
# 3. GitHub OAuth Device Flow — 사전: HARNESS_GITHUB_CLIENT_ID 설정
|
|
267
|
+
npm run auth:github:login
|
|
268
|
+
npm run auth:github:status # backend / scope / 유효성 확인
|
|
269
|
+
|
|
270
|
+
# 4. OS keychain 종단 검증
|
|
271
|
+
HARNESS_KEYCHAIN_SMOKE=1 npm run test:keychain
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
PR #4 (codex 0.125+ 호환) 는 본 smoke 와 무관 — 별도 검증 (`npm run verify:codex`).
|
|
275
|
+
|
|
276
|
+
## 9. 변경 이력
|
|
277
|
+
|
|
278
|
+
| 일자 | Phase | 비고 |
|
|
279
|
+
|---|---|---|
|
|
280
|
+
| 2026-04-29 | 1-5 | 본 문서 작성. 5개 PR 단위 진행 예정. |
|
|
281
|
+
| 2026-04-30 | 1-3 | 4-stack PR (#1-#3 auth + #4 codex 호환) CI 통과. §8 acceptance criteria 추가. |
|
|
282
|
+
| 2026-04-30 | 1-3 | PR #1-#3 main 머지 완료 (`60e9de9` → `7c4f2c8`, +4 commits, rebase). PR #2/#3 은 phase-1 옛 SHA 포함으로 force-push 1회씩 (`--onto origin/main` + `--force-with-lease`). Smoke 3/4 PASS — #1 (Claude Max 구독 OAuth) / #2 (pre-bash-dispatcher 차단 3 케이스) / #4 (Windows Credential Manager). #3 GitHub OAuth Device Flow 는 OAuth App 미등록으로 deferred. PR #4 (codex 0.125+) 무관, OPEN 잔존. |
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
> Format: Keep a Changelog. Versioning: SemVer.
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Add `npm run demo:quick` for the shortest no-API `doctor -> run -> gate status` first experience.
|
|
9
|
+
- Add `docs/WHY-NEKOWORK.md` to clarify NEKOWORK's comparison against agent-pack, discipline, team, and autopilot tools.
|
|
10
|
+
- Add `docs/PUBLISH-ALPHA.md` and a third-party `sindresorhus/is-plain-obj` case study.
|
|
11
|
+
- Add `npm run demo:external` to create a disposable target project and verify repository-based porting end to end.
|
|
12
|
+
- Add `docs/EXAMPLE-PROJECT.md` and e2e coverage for the external project demo.
|
|
13
|
+
- Add product principles and core invariants for the Claude work -> Codex verification -> Human Gate runtime.
|
|
14
|
+
- Add decomposed public workflow commands: `ask`, `team`, `work`, `verify`, `gate`, `ship`, `apply`, and `run`.
|
|
15
|
+
- Add `review-cycle` as an explicit compatibility alias for the legacy full review workflow.
|
|
16
|
+
- Add `ralph --engine run` so Ralph can repeat the decomposed `work -> verify -> ship` path.
|
|
17
|
+
- Add `wait` wakeup processing for supported active sessions with human-gate blocking and resume backoff.
|
|
18
|
+
- Add product, frontend, and testing install profiles.
|
|
19
|
+
- Add shared risk classifier, acceptance criteria artifact enforcement, and profile safety validation.
|
|
20
|
+
- Add standalone `CORE-INVARIANTS`, `CLI-STAGES`, and `RISK-CLASSIFIER` docs.
|
|
21
|
+
- Add trading dashboard mock example for financial UI gating.
|
|
22
|
+
- Add `examples/trading-dashboard-mock`, a standalone static case-study target with local mock-boundary checks.
|
|
23
|
+
- Add `examples/github-actions-hardening`, a standalone CI workflow hardening target with local YAML policy checks.
|
|
24
|
+
- Add `quality` profile and AI development lifecycle documentation for disciplined, evidence-based work.
|
|
25
|
+
- Add evidence-based review issue fields to the handoff schema.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
- Prepare package metadata for public alpha `0.1.0-alpha.0` with `private: false`; npm publish remains blocked until owner auth is active.
|
|
29
|
+
- Record public alpha dry-run publish success and live publish `ENEEDAUTH` blocker.
|
|
30
|
+
- Rewrite `docs/AUDIT.md` and `docs/ARCHITECTURE.md` with clean public-facing ASCII content.
|
|
31
|
+
- Link the external project demo from README, Quickstart, Porting, Demo, and Release Readiness docs.
|
|
32
|
+
- Keep `review` as the legacy full cycle while making `run` the preferred decomposed wrapper for new automation.
|
|
33
|
+
- Make `team-lite` explicitly read-only handoff oriented.
|
|
34
|
+
- Accept explicit safety intent flags: `team --no-write`, `work --single-executor`, and `ship --require-clean-gates`.
|
|
35
|
+
- Recheck risk policy in `verify` and `ship` so financial/deploy-sensitive work cannot skip Human Gate.
|
|
36
|
+
- Clarify the beginner Golden Path, the advanced decomposed path, and the `run`/`apply` safety boundary.
|
|
37
|
+
- Refresh Quickstart, Advanced, Architecture, Release Readiness, Audit, Runbook, and generated CODEMAP docs for the expanded alpha surface.
|
|
38
|
+
|
|
39
|
+
### Security
|
|
40
|
+
- Preserve single-executor mutation, Codex verification, Human Gate, and explicit apply as non-bypassable workflow invariants.
|
|
41
|
+
- Refresh transitive dependency lockfile entries so `npm audit --audit-level=moderate` reports 0 vulnerabilities.
|
|
42
|
+
|
|
43
|
+
## [0.0.3] - 2026-05-03
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
- Rewrite `scripts/build-codemaps.js` with stable ASCII output.
|
|
47
|
+
- Regenerate every `docs/CODEMAPS/*.md` file with readable headings, ASCII trees, and clean export tables.
|
|
48
|
+
- Add `doctor --gemini-smoke` so Gemini live auth can be explicitly included in the local health report.
|
|
49
|
+
- Rewrite `docs/PORTING.md` as a clean repository/submodule integration guide.
|
|
50
|
+
- Refresh README, Quickstart, Setup, Runbook, Demo, Advanced, and Release Readiness docs for the `0.0.3` repository-based release line.
|
|
51
|
+
- Bump package metadata to `0.0.3` and clean the package description.
|
|
52
|
+
|
|
53
|
+
### Security
|
|
54
|
+
- Keep `private: true`; public npm publish remains intentionally disabled.
|
|
55
|
+
- Keep delegated local CLI auth as the default provider path.
|
|
56
|
+
|
|
57
|
+
### Verified
|
|
58
|
+
- `npm run lint`
|
|
59
|
+
- `npm test`
|
|
60
|
+
- `node scripts/repair.js --check`
|
|
61
|
+
- `node scripts/sync-claude-md.js --check`
|
|
62
|
+
- `node scripts/build-codemaps.js --check`
|
|
63
|
+
- `node scripts/cli.js doctor`
|
|
64
|
+
- `node scripts/cli.js doctor --quick --gemini-smoke`
|
|
65
|
+
- `npm audit --audit-level=moderate`
|
|
66
|
+
- `npm pack --dry-run --json`
|
|
67
|
+
|
|
68
|
+
## [0.0.2] - 2026-04-29
|
|
69
|
+
|
|
70
|
+
### Changed
|
|
71
|
+
- Rename package metadata to `@ps-neko/nekowork` while keeping npm publishing disabled.
|
|
72
|
+
- Add public first-run documentation for source checkout, mock review, local CLI auth, and release gates.
|
|
73
|
+
- Add `harness doctor` for local environment, provider CLI/auth, API key override, and generated-output freshness checks.
|
|
74
|
+
- Add `docs/ADVANCED.md`, `docs/SECURITY.md`, and `docs/DEMO.md`.
|
|
75
|
+
- Move advanced runtime features out of the first-run path.
|
|
76
|
+
- Add external project `--project-root` support for install/apply, review, Ralph, team-lite, provider CLI resolution, and session state.
|
|
77
|
+
- Add provider CLI path hardening for Claude, Codex, and Gemini.
|
|
78
|
+
- Add security hardening checks for workflows, MCP pins, dependency specs, action refs, OIDC policy, and package lock presence.
|
|
79
|
+
- Add `team-lite` staged pipeline support.
|
|
80
|
+
- Add Rust runtime verification through `npm run verify:runtime`.
|
|
81
|
+
|
|
82
|
+
### Verified
|
|
83
|
+
- Local Claude CLI smoke passed with delegated Claude Code auth.
|
|
84
|
+
- Local Codex CLI smoke passed with ChatGPT login session.
|
|
85
|
+
- Local Gemini CLI smoke passed with Gemini CLI login session.
|
|
86
|
+
- Unit, integration, and e2e tests passed locally and in CI.
|
|
87
|
+
- GitHub Actions validate/review workflows passed.
|
|
88
|
+
|
|
89
|
+
## [0.0.1] - 2026-04-29
|
|
90
|
+
|
|
91
|
+
### Added
|
|
92
|
+
- Initial NEKOWORK/HARNESS catalog with agents, skills, hooks, rules, schemas, and multi-harness builders.
|
|
93
|
+
- `agent.yaml` as the single source catalog.
|
|
94
|
+
- Build projections for Claude Code, Codex CLI, Cursor, Gemini CLI, and OpenCode.
|
|
95
|
+
- Deterministic mock review flow with handoff persistence.
|
|
96
|
+
- Initial CLI verbs for install, validate, review, plan, sessions, costs, instincts, and version.
|
|
97
|
+
- Initial audit, architecture, and development notes.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# CLI Stages
|
|
2
|
+
|
|
3
|
+
The long-term NEKOWORK workflow is:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
ask -> plan -> team -> work -> verify -> gate -> ship -> apply
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Stage Contract
|
|
10
|
+
|
|
11
|
+
| Stage | Purpose | Mutation |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| `ask` | Clarify goal, scope, risk, and draft success criteria. | No project mutation |
|
|
14
|
+
| `plan` | Produce implementation plan and acceptance criteria. | No project mutation |
|
|
15
|
+
| `team` | Produce read-only handoffs from selected worker perspectives. | No project mutation |
|
|
16
|
+
| `work` | Run one executor against the accepted scope. | Isolated single-executor work |
|
|
17
|
+
| `verify` | Run Codex review, optional Codex challenge, and risk gate logic. | No project mutation |
|
|
18
|
+
| `gate` | Record human approval or block for an open gate. | No project mutation |
|
|
19
|
+
| `ship` | Produce ship/no-ship readiness markers and handoff. | No project mutation |
|
|
20
|
+
| `apply` | Apply a verified `SHIP_READY` live-work diff. | Controlled project mutation |
|
|
21
|
+
|
|
22
|
+
## Beginner And Advanced Paths
|
|
23
|
+
|
|
24
|
+
Most users should start with this Beginner path:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
doctor -> ask -> run -> gate status
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`run` is the short safe wrapper. It executes `work -> verify -> ship`, does not apply by default, and stops on Human Gate.
|
|
31
|
+
|
|
32
|
+
Advanced path:
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
ask -> plan -> team -> work -> verify -> gate -> ship -> apply
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Use the advanced path when the change needs a separate plan artifact, read-only team handoffs, explicit verification control, or a manual apply step.
|
|
39
|
+
|
|
40
|
+
Quality-sensitive runs can add profile policy:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
harness ask "task" --profile quality
|
|
44
|
+
harness work "task" --profile quality --session <id>
|
|
45
|
+
harness verify "task" --profile quality --strict-quality --session <id>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`--strict-quality` turns missing evidence or acceptance coverage warnings into a fix-required verification verdict.
|
|
49
|
+
|
|
50
|
+
## Plan And Run Policy
|
|
51
|
+
|
|
52
|
+
For the `0.0.3` line:
|
|
53
|
+
|
|
54
|
+
- `plan` is recommended before `work` for non-trivial changes.
|
|
55
|
+
- `run` does not call `plan`; it remains a compact wrapper around `work -> verify -> ship`.
|
|
56
|
+
- `work` always ensures `acceptance-criteria.json`, using `prd.json` when available or a task-derived minimum otherwise.
|
|
57
|
+
- Future release lines may add `run --with-plan` or require an accepted plan artifact for higher-risk work.
|
|
58
|
+
- `apply` is always explicit. `run` applies only with `--apply`.
|
|
59
|
+
|
|
60
|
+
## Explicit Safety Aliases
|
|
61
|
+
|
|
62
|
+
These flags are accepted as public intent markers:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
harness team "task" --no-write
|
|
66
|
+
harness work "task" --single-executor
|
|
67
|
+
harness ship "task" --session <id> --require-clean-gates
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
They do not weaken behavior. They make the contract readable at the call site.
|
|
71
|
+
|
|
72
|
+
## Compatibility Window
|
|
73
|
+
|
|
74
|
+
Short term:
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
review = legacy full review cycle
|
|
78
|
+
review-cycle = explicit legacy alias
|
|
79
|
+
verify = Codex-only verification
|
|
80
|
+
run = work -> verify -> ship, optional apply
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Future transition:
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
run/work = execution wrapper
|
|
87
|
+
review = verification-only
|
|
88
|
+
review-cycle = legacy full-cycle compatibility
|
|
89
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# CODEMAPS: index
|
|
2
|
+
|
|
3
|
+
> Generated by `scripts/build-codemaps.js`. Do not edit directly.
|
|
4
|
+
|
|
5
|
+
| Area | File |
|
|
6
|
+
|---|---|
|
|
7
|
+
| scripts | [scripts.md](./scripts.md) |
|
|
8
|
+
| agents | [agents.md](./agents.md) |
|
|
9
|
+
| skills | [skills.md](./skills.md) |
|
|
10
|
+
| hooks | [hooks.md](./hooks.md) |
|
|
11
|
+
| manifests | [manifests.md](./manifests.md) |
|
|
12
|
+
| schemas | [schemas.md](./schemas.md) |
|
|
13
|
+
| bridge | [bridge.md](./bridge.md) |
|
|
14
|
+
| rules | [rules.md](./rules.md) |
|
|
15
|
+
| tests | [tests.md](./tests.md) |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# CODEMAP: agents
|
|
2
|
+
|
|
3
|
+
> Generated by `scripts/build-codemaps.js` from `agents/`. Do not edit directly.
|
|
4
|
+
> Directory shape and exported JS symbols only. Code bodies are intentionally omitted.
|
|
5
|
+
|
|
6
|
+
## Directory Tree
|
|
7
|
+
|
|
8
|
+
```text
|
|
9
|
+
agents/
|
|
10
|
+
|-- architect.md
|
|
11
|
+
|-- code-reviewer.md
|
|
12
|
+
|-- codex-challenger.md
|
|
13
|
+
|-- codex-reviewer.md
|
|
14
|
+
|-- debugger.md
|
|
15
|
+
|-- doc-writer.md
|
|
16
|
+
|-- executor.md
|
|
17
|
+
|-- planner.md
|
|
18
|
+
|-- research.md
|
|
19
|
+
|-- security-reviewer.md
|
|
20
|
+
`-- test-engineer.md
|
|
21
|
+
```
|
|
22
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# CODEMAP: bridge
|
|
2
|
+
|
|
3
|
+
> Generated by `scripts/build-codemaps.js` from `bridge/`. Do not edit directly.
|
|
4
|
+
> Directory shape and exported JS symbols only. Code bodies are intentionally omitted.
|
|
5
|
+
|
|
6
|
+
## Directory Tree
|
|
7
|
+
|
|
8
|
+
```text
|
|
9
|
+
bridge/
|
|
10
|
+
`-- mcp-server.js
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## JS Exports
|
|
14
|
+
|
|
15
|
+
| File | Exports | Description |
|
|
16
|
+
|---|---|---|
|
|
17
|
+
| `mcp-server.js` | _(none)_ | HARNESS MCP . 4 : state_read, state_write, notepad_append, handoff_write. .mcp.json MCP (github, context7, exa, memory) namespace proxy . 4 |
|
|
18
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# CODEMAP: hooks
|
|
2
|
+
|
|
3
|
+
> Generated by `scripts/build-codemaps.js` from `hooks/`. Do not edit directly.
|
|
4
|
+
> Directory shape and exported JS symbols only. Code bodies are intentionally omitted.
|
|
5
|
+
|
|
6
|
+
## Directory Tree
|
|
7
|
+
|
|
8
|
+
```text
|
|
9
|
+
hooks/
|
|
10
|
+
|-- scripts/
|
|
11
|
+
| |-- config-protection.js
|
|
12
|
+
| |-- gateguard-fact-force.js
|
|
13
|
+
| |-- persistent-mode.mjs
|
|
14
|
+
| |-- pre-bash-dispatcher.js
|
|
15
|
+
| `-- quality-gate.js
|
|
16
|
+
`-- hooks.json
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## JS Exports
|
|
20
|
+
|
|
21
|
+
| File | Exports | Description |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `scripts/config-protection.js` | _(none)_ | PreToolUse(Edit\|Write) config-protection. .env / *.pem / *.key / credentials . |
|
|
24
|
+
| `scripts/gateguard-fact-force.js` | _(none)_ | PreToolUse(Edit\|Write) gateguard-fact-force. "Are you sure?" . importer / public API / schema . : 1. tool_input.file_path ? . 2. .harness/s |
|
|
25
|
+
| `scripts/persistent-mode.mjs` | _(none)_ | Stop persistent-mode. If .harness/state/sessions/<id>/active exists, drop wakeup.json for `harness wait start` to process. |
|
|
26
|
+
| `scripts/pre-bash-dispatcher.js` | _(none)_ | PreToolUse(Bash) . ECC pre-bash-dispatcher.js . . ENV on/off. stdin JSON Claude Code hook , . |
|
|
27
|
+
| `scripts/quality-gate.js` | _(none)_ | PostToolUse(Edit\|Write) quality-gate. : - .ts/.tsx: tsc --noEmit ( + transitive). isolated. - .js/.mjs/.cjs: node --check . - .py: ruff che |
|
|
28
|
+
|