@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.
Files changed (203) hide show
  1. package/AGENTS.md +112 -0
  2. package/CLAUDE.md +81 -0
  3. package/LICENSE +21 -0
  4. package/README.md +283 -0
  5. package/REVIEW.md +96 -0
  6. package/RULES.md +51 -0
  7. package/SOUL.md +21 -0
  8. package/WORKING-CONTEXT.md +52 -0
  9. package/agent.yaml +219 -0
  10. package/agents/architect.md +57 -0
  11. package/agents/code-reviewer.md +60 -0
  12. package/agents/codex-challenger.md +53 -0
  13. package/agents/codex-reviewer.md +56 -0
  14. package/agents/debugger.md +33 -0
  15. package/agents/doc-writer.md +51 -0
  16. package/agents/executor.md +41 -0
  17. package/agents/planner.md +49 -0
  18. package/agents/research.md +50 -0
  19. package/agents/security-reviewer.md +47 -0
  20. package/agents/test-engineer.md +41 -0
  21. package/bridge/mcp-server.js +301 -0
  22. package/commands/claude-led-codex-review.md +29 -0
  23. package/docs/ADVANCED.md +321 -0
  24. package/docs/AI-DEVELOPMENT-LIFECYCLE.md +105 -0
  25. package/docs/ARCHITECTURE.md +205 -0
  26. package/docs/AUDIT.md +114 -0
  27. package/docs/AUTH-MIGRATION.md +282 -0
  28. package/docs/CHANGELOG.md +97 -0
  29. package/docs/CLI-STAGES.md +89 -0
  30. package/docs/CODEMAPS/README.md +15 -0
  31. package/docs/CODEMAPS/agents.md +22 -0
  32. package/docs/CODEMAPS/bridge.md +18 -0
  33. package/docs/CODEMAPS/hooks.md +28 -0
  34. package/docs/CODEMAPS/manifests.md +14 -0
  35. package/docs/CODEMAPS/rules.md +22 -0
  36. package/docs/CODEMAPS/schemas.md +21 -0
  37. package/docs/CODEMAPS/scripts.md +158 -0
  38. package/docs/CODEMAPS/skills.md +29 -0
  39. package/docs/CODEMAPS/tests.md +98 -0
  40. package/docs/CORE-INVARIANTS.md +38 -0
  41. package/docs/DEMO.md +110 -0
  42. package/docs/EXAMPLE-PROJECT.md +92 -0
  43. package/docs/PORTING.md +154 -0
  44. package/docs/PRODUCT-PRINCIPLES.md +303 -0
  45. package/docs/PUBLISH-ALPHA.md +106 -0
  46. package/docs/QUICKSTART.md +344 -0
  47. package/docs/RELEASE-READINESS.md +140 -0
  48. package/docs/RISK-CLASSIFIER.md +50 -0
  49. package/docs/RUNBOOK.md +146 -0
  50. package/docs/SECURITY.md +79 -0
  51. package/docs/SETUP.md +142 -0
  52. package/docs/WHY-NEKOWORK.md +64 -0
  53. package/docs/case-studies/README.md +16 -0
  54. package/docs/case-studies/SINDRESORHUS-IS-PLAIN-OBJ.md +141 -0
  55. package/docs/dev-log/2026-04-29-p1-recovery.md +142 -0
  56. package/docs/dev-log/2026-04-29-week1-4.md +81 -0
  57. package/docs/examples/GITHUB-ACTIONS-HARDENING.md +86 -0
  58. package/docs/examples/QUALITY-LIFECYCLE-SMOKE.md +32 -0
  59. package/docs/examples/TRADING-DASHBOARD-MOCK.md +65 -0
  60. package/docs/workflows-stash/README.md +32 -0
  61. package/docs/workflows-stash/harness-review.yml +166 -0
  62. package/docs/workflows-stash/harness-validate.yml +48 -0
  63. package/examples/github-actions-hardening/.github/workflows/hardened-validate.yml +38 -0
  64. package/examples/github-actions-hardening/README.md +31 -0
  65. package/examples/github-actions-hardening/case-study/ASK.md +26 -0
  66. package/examples/github-actions-hardening/case-study/GATE_STATUS.md +28 -0
  67. package/examples/github-actions-hardening/case-study/PLAN.md +25 -0
  68. package/examples/github-actions-hardening/case-study/SHIP_READY.md +21 -0
  69. package/examples/github-actions-hardening/case-study/TASK.md +30 -0
  70. package/examples/github-actions-hardening/case-study/TEAM_HANDOFFS.md +37 -0
  71. package/examples/github-actions-hardening/case-study/VERIFY_SUMMARY.md +35 -0
  72. package/examples/github-actions-hardening/case-study/WORK_SUMMARY.md +24 -0
  73. package/examples/github-actions-hardening/package.json +12 -0
  74. package/examples/github-actions-hardening/scripts/check.mjs +43 -0
  75. package/examples/quality-lifecycle-smoke/README.md +30 -0
  76. package/examples/quality-lifecycle-smoke/case-study/ASK.md +24 -0
  77. package/examples/quality-lifecycle-smoke/case-study/GATE_STATUS.md +10 -0
  78. package/examples/quality-lifecycle-smoke/case-study/PLAN.md +19 -0
  79. package/examples/quality-lifecycle-smoke/case-study/SHIP_READY.md +11 -0
  80. package/examples/quality-lifecycle-smoke/case-study/TASK.md +19 -0
  81. package/examples/quality-lifecycle-smoke/case-study/TEAM_HANDOFFS.md +21 -0
  82. package/examples/quality-lifecycle-smoke/case-study/VERIFY_SUMMARY.md +44 -0
  83. package/examples/quality-lifecycle-smoke/case-study/WORK_SUMMARY.md +19 -0
  84. package/examples/quality-lifecycle-smoke/package.json +8 -0
  85. package/examples/quality-lifecycle-smoke/scripts/check.mjs +44 -0
  86. package/examples/trading-dashboard-mock/README.md +33 -0
  87. package/examples/trading-dashboard-mock/case-study/ASK.md +24 -0
  88. package/examples/trading-dashboard-mock/case-study/GATE_STATUS.md +28 -0
  89. package/examples/trading-dashboard-mock/case-study/PLAN.md +23 -0
  90. package/examples/trading-dashboard-mock/case-study/SHIP_READY.md +21 -0
  91. package/examples/trading-dashboard-mock/case-study/TASK.md +29 -0
  92. package/examples/trading-dashboard-mock/case-study/TEAM_HANDOFFS.md +49 -0
  93. package/examples/trading-dashboard-mock/case-study/VERIFY_SUMMARY.md +35 -0
  94. package/examples/trading-dashboard-mock/case-study/WORK_SUMMARY.md +27 -0
  95. package/examples/trading-dashboard-mock/fixtures/market.json +9 -0
  96. package/examples/trading-dashboard-mock/index.html +76 -0
  97. package/examples/trading-dashboard-mock/package.json +9 -0
  98. package/examples/trading-dashboard-mock/scripts/check.mjs +54 -0
  99. package/examples/trading-dashboard-mock/src/app.js +83 -0
  100. package/examples/trading-dashboard-mock/src/styles.css +227 -0
  101. package/hooks/hooks.json +44 -0
  102. package/hooks/scripts/config-protection.js +34 -0
  103. package/hooks/scripts/gateguard-fact-force.js +146 -0
  104. package/hooks/scripts/persistent-mode.mjs +27 -0
  105. package/hooks/scripts/pre-bash-dispatcher.js +63 -0
  106. package/hooks/scripts/quality-gate.js +106 -0
  107. package/manifests/install-components.json +195 -0
  108. package/manifests/install-modules.json +101 -0
  109. package/manifests/install-profiles.json +134 -0
  110. package/package.json +96 -0
  111. package/rules/common/coding-style.md +71 -0
  112. package/rules/common/security.md +69 -0
  113. package/rules/common/testing.md +58 -0
  114. package/rules/python/coding-style.md +80 -0
  115. package/rules/python/testing.md +86 -0
  116. package/rules/typescript/coding-style.md +97 -0
  117. package/rules/typescript/security.md +67 -0
  118. package/rules/typescript/testing.md +78 -0
  119. package/schemas/agent-yaml.schema.json +168 -0
  120. package/schemas/agent.schema.json +32 -0
  121. package/schemas/handoff.schema.json +105 -0
  122. package/schemas/hooks.schema.json +35 -0
  123. package/schemas/install-components.schema.json +46 -0
  124. package/schemas/install-modules.schema.json +39 -0
  125. package/schemas/install-profiles.schema.json +32 -0
  126. package/schemas/install-state.schema.json +42 -0
  127. package/schemas/routing.schema.json +42 -0
  128. package/schemas/skill.schema.json +19 -0
  129. package/scripts/agents/dispatch.js +144 -0
  130. package/scripts/agents/runners/claude.js +214 -0
  131. package/scripts/agents/runners/codex.js +233 -0
  132. package/scripts/agents/runners/gemini.js +92 -0
  133. package/scripts/agents/runners/mock.js +107 -0
  134. package/scripts/auth/github-import-gh.js +52 -0
  135. package/scripts/auth/github-login.js +79 -0
  136. package/scripts/auth/github-logout.js +21 -0
  137. package/scripts/auth/github-status.js +46 -0
  138. package/scripts/build-claude.js +101 -0
  139. package/scripts/build-codemaps.js +286 -0
  140. package/scripts/build-codex.js +93 -0
  141. package/scripts/build-cursor.js +132 -0
  142. package/scripts/build-gemini.js +117 -0
  143. package/scripts/build-opencode.js +117 -0
  144. package/scripts/ci/catalog.js +120 -0
  145. package/scripts/ci/check-markers.js +48 -0
  146. package/scripts/ci/security-hardening.js +270 -0
  147. package/scripts/ci/validate-agents.js +88 -0
  148. package/scripts/ci/validate-hooks.js +99 -0
  149. package/scripts/ci/validate-manifests.js +128 -0
  150. package/scripts/ci/validate-skills.js +93 -0
  151. package/scripts/cli.js +1134 -0
  152. package/scripts/core/auth-guard.js +22 -0
  153. package/scripts/core/build-roots.js +11 -0
  154. package/scripts/core/cli-resolver.js +64 -0
  155. package/scripts/core/execution-workspace.js +84 -0
  156. package/scripts/core/git-mutation-guard.js +79 -0
  157. package/scripts/core/install-state.js +125 -0
  158. package/scripts/core/json-extractor.js +32 -0
  159. package/scripts/core/subprocess.js +74 -0
  160. package/scripts/daemon/wait.js +278 -0
  161. package/scripts/demo-external-project.js +222 -0
  162. package/scripts/demo-quick-run.js +193 -0
  163. package/scripts/demo-review.js +204 -0
  164. package/scripts/doctor.js +296 -0
  165. package/scripts/install-apply.js +185 -0
  166. package/scripts/install-plan.js +411 -0
  167. package/scripts/lib/acceptance-criteria.js +105 -0
  168. package/scripts/lib/costs.js +82 -0
  169. package/scripts/lib/instincts.js +194 -0
  170. package/scripts/lib/keychain.js +85 -0
  171. package/scripts/lib/profile-policy.js +134 -0
  172. package/scripts/lib/profile-safety.js +81 -0
  173. package/scripts/lib/risk-classifier.js +145 -0
  174. package/scripts/lib/router.js +138 -0
  175. package/scripts/lib/severity.js +99 -0
  176. package/scripts/lib/token-vault.js +136 -0
  177. package/scripts/orchestrators/apply.js +225 -0
  178. package/scripts/orchestrators/ask.js +143 -0
  179. package/scripts/orchestrators/gate.js +179 -0
  180. package/scripts/orchestrators/ralph.js +179 -0
  181. package/scripts/orchestrators/review.js +452 -0
  182. package/scripts/orchestrators/run.js +151 -0
  183. package/scripts/orchestrators/ship.js +339 -0
  184. package/scripts/orchestrators/team-lite.js +270 -0
  185. package/scripts/orchestrators/team.js +244 -0
  186. package/scripts/orchestrators/verify.js +306 -0
  187. package/scripts/orchestrators/work.js +207 -0
  188. package/scripts/portability/simulate-port.js +220 -0
  189. package/scripts/repair.js +184 -0
  190. package/scripts/sync-claude-md.js +220 -0
  191. package/scripts/verify/claude-live.js +30 -0
  192. package/scripts/verify/codex-live.js +60 -0
  193. package/scripts/verify/gemini-live.js +48 -0
  194. package/scripts/verify/runtime.js +105 -0
  195. package/skills/claude-led-codex-review/SKILL.md +133 -0
  196. package/skills/plan-eng-review/SKILL.md +51 -0
  197. package/skills/porting/SKILL.md +69 -0
  198. package/skills/ralph/SKILL.md +48 -0
  199. package/skills/release-readiness/SKILL.md +62 -0
  200. package/skills/review/SKILL.md +42 -0
  201. package/skills/security-hardening/SKILL.md +59 -0
  202. package/skills/ship/SKILL.md +44 -0
  203. package/skills/tdd-workflow/SKILL.md +42 -0
@@ -0,0 +1,79 @@
1
+ # Security Model
2
+
3
+ NEKOWORK is local-first by default. The safest path is to let provider CLIs manage their own local login sessions instead of passing long-lived API keys through the harness.
4
+
5
+ ## Delegated CLI Auth
6
+
7
+ Default live provider calls use local CLI sessions:
8
+
9
+ - Claude: `claude` CLI session
10
+ - Codex: `codex` CLI session
11
+ - Gemini: `gemini` CLI session
12
+
13
+ The harness calls these CLIs as local processes and does not need to store LLM provider API keys.
14
+
15
+ ## API Key Guard
16
+
17
+ Before delegated provider calls, NEKOWORK blocks common long-lived API key environment variables by default:
18
+
19
+ - `ANTHROPIC_API_KEY`
20
+ - `OPENAI_API_KEY`
21
+ - `GEMINI_API_KEY`
22
+ - `GOOGLE_API_KEY`
23
+
24
+ Use `HARNESS_AUTH_ALLOW_ENV_OVERRIDE=1` only when a metered API-key path is intentional.
25
+
26
+ ## CLI Path Trust
27
+
28
+ Provider CLIs should resolve from user/global install locations, not from the current project workspace. This prevents a repository-local `claude`, `codex`, or `gemini` shim from hijacking delegated auth.
29
+
30
+ If a local test shim is intentional, opt in explicitly with provider-specific environment variables such as:
31
+
32
+ ```bash
33
+ HARNESS_CODEX_ALLOW_WORKSPACE_BIN=1
34
+ HARNESS_CLAUDE_ALLOW_WORKSPACE_BIN=1
35
+ HARNESS_GEMINI_ALLOW_WORKSPACE_BIN=1
36
+ ```
37
+
38
+ ## Git Mutation Guard
39
+
40
+ Read-only or handoff-mode provider runs are checked after execution. Unexpected workspace mutations are blocked unless an explicit provider-specific override is set.
41
+
42
+ This is especially important for Codex read-only review, because the Codex sandbox should not be treated as the only security boundary.
43
+
44
+ ## MCP Supply Chain
45
+
46
+ MCP stdio servers must use exact SemVer pins. HTTP MCP servers must use HTTPS.
47
+
48
+ The `security-hardening` gate checks MCP pins, workflow permissions, job timeouts, dependency specs, OIDC policy, and package-lock presence:
49
+
50
+ ```bash
51
+ npm run security:hardening
52
+ ```
53
+
54
+ ## Human Gates
55
+
56
+ Automation stops for high-risk conditions:
57
+
58
+ - critical severity
59
+ - repeated fix rounds
60
+ - large blast radius
61
+ - explicit security-sensitive review paths
62
+
63
+ The goal is not fully autonomous shipping. The goal is a local workflow that preserves independent review and human control.
64
+
65
+ ## Audit And Redaction
66
+
67
+ Audit records are designed to redact common token fields. Do not commit secrets, `.env` files, private keys, or provider tokens to the repository.
68
+
69
+ Run the standard release gates before publishing or tagging:
70
+
71
+ ```bash
72
+ npm run lint
73
+ npm test
74
+ npm audit --audit-level=moderate
75
+ node scripts/repair.js --check
76
+ node scripts/sync-claude-md.js --check
77
+ node scripts/build-codemaps.js --check
78
+ npm run security:hardening
79
+ ```
package/docs/SETUP.md ADDED
@@ -0,0 +1,142 @@
1
+ # Setup
2
+
3
+ Start with [QUICKSTART.md](QUICKSTART.md) if this is your first run. This page is the deeper contributor setup guide.
4
+
5
+ NEKOWORK `0.1.0-alpha.0` is prepared as a public alpha candidate but is not published to npm yet. Use a source checkout, submodule, or local repository integration until npm owner auth is available and the alpha is published.
6
+
7
+ ## Requirements
8
+
9
+ - Node.js 22+
10
+ - npm
11
+ - git
12
+ - Optional: Claude Code CLI, Codex CLI, Gemini CLI
13
+ - Optional for Rust runtime: Rust toolchain and platform build tools
14
+
15
+ ## Source Checkout
16
+
17
+ ```bash
18
+ git clone https://github.com/Ps-Neko/NEKOWORK.git harness
19
+ cd harness
20
+ npm ci
21
+ node scripts/cli.js doctor --quick
22
+ npm run lint
23
+ npm test
24
+ ```
25
+
26
+ ## Local Generated Outputs
27
+
28
+ Preview the catalog:
29
+
30
+ ```bash
31
+ node scripts/install-plan.js --list
32
+ node scripts/install-plan.js --profile developer
33
+ ```
34
+
35
+ Apply generated harness outputs locally:
36
+
37
+ ```bash
38
+ node scripts/install-apply.js --profile developer
39
+ ```
40
+
41
+ Check freshness:
42
+
43
+ ```bash
44
+ node scripts/repair.js --check
45
+ node scripts/sync-claude-md.js --check
46
+ node scripts/build-codemaps.js --check
47
+ ```
48
+
49
+ ## Live Provider Setup
50
+
51
+ Mock mode is the default and requires no provider login. Live mode delegates to local CLI sessions.
52
+
53
+ ### Claude
54
+
55
+ ```bash
56
+ claude auth status
57
+ npm run verify:claude
58
+ ```
59
+
60
+ The default Claude runner uses the local Claude Code CLI session. `ANTHROPIC_API_KEY` is not required.
61
+
62
+ ### Codex
63
+
64
+ ```bash
65
+ npm install -g @openai/codex
66
+ codex login
67
+ codex login status
68
+ npm run verify:codex
69
+ ```
70
+
71
+ ### Gemini
72
+
73
+ ```bash
74
+ gemini
75
+ npm run verify:gemini
76
+ node scripts/cli.js doctor --quick --gemini-smoke
77
+ ```
78
+
79
+ Gemini CLI does not expose the same non-interactive auth-status contract as Claude/Codex. Plain `doctor` checks installation and warns that auth was not checked; `doctor --gemini-smoke` runs the explicit live smoke and will fail if headless Gemini auth is not ready.
80
+
81
+ ## API Key Overrides
82
+
83
+ Unset long-lived provider API keys for delegated local CLI auth:
84
+
85
+ ```bash
86
+ unset ANTHROPIC_API_KEY
87
+ unset OPENAI_API_KEY
88
+ unset GEMINI_API_KEY
89
+ unset GOOGLE_API_KEY
90
+ ```
91
+
92
+ PowerShell:
93
+
94
+ ```powershell
95
+ Remove-Item Env:ANTHROPIC_API_KEY -ErrorAction SilentlyContinue
96
+ Remove-Item Env:OPENAI_API_KEY -ErrorAction SilentlyContinue
97
+ Remove-Item Env:GEMINI_API_KEY -ErrorAction SilentlyContinue
98
+ Remove-Item Env:GOOGLE_API_KEY -ErrorAction SilentlyContinue
99
+ ```
100
+
101
+ Use `HARNESS_AUTH_ALLOW_ENV_OVERRIDE=1` only when a metered API-key path is intentional.
102
+
103
+ ## GitHub Auth
104
+
105
+ GitHub OAuth helpers are optional:
106
+
107
+ ```bash
108
+ npm run auth:github:login
109
+ npm run auth:github:status
110
+ npm run auth:github:logout
111
+ ```
112
+
113
+ Workflow file pushes may require a token with `workflow` scope. The local harness does not need this for mock review or source checkout usage.
114
+
115
+ ## Rust Runtime
116
+
117
+ The Rust runtime is optional for 0.0.3:
118
+
119
+ ```bash
120
+ npm run verify:runtime
121
+ ```
122
+
123
+ The Node CLI remains the primary user path.
124
+
125
+ ## Troubleshooting
126
+
127
+ `npm ci` fails:
128
+
129
+ - Confirm `node -v` is 22 or newer.
130
+ - Check proxy and registry settings in `.npmrc`.
131
+
132
+ `doctor` reports stale generated files:
133
+
134
+ - Run `node scripts/repair.js`.
135
+ - Run `node scripts/sync-claude-md.js`.
136
+ - Run `node scripts/build-codemaps.js`.
137
+
138
+ `--live` fails:
139
+
140
+ - Run `node scripts/cli.js doctor --quick`.
141
+ - Confirm provider CLI login.
142
+ - Unset API key environment variables unless intentionally opted in.
@@ -0,0 +1,64 @@
1
+ # Why NEKOWORK
2
+
3
+ NEKOWORK is not another Claude Code power pack. It is a local-first verification harness that turns AI-generated work into auditable, gated, explicitly applied changes.
4
+
5
+ ## Position
6
+
7
+ ```text
8
+ Superpowers teaches the agent discipline.
9
+ Everything Claude Code gives the agent a broad operating environment.
10
+ GStack turns the agent into a startup-style team.
11
+ OMC makes the agent run more autonomously.
12
+ NEKOWORK makes the agent prove, gate, and apply safely.
13
+ ```
14
+
15
+ NEKOWORK can absorb useful ideas from those systems, but only as capabilities. The architecture stays fixed around:
16
+
17
+ ```text
18
+ Claude work -> Codex verification -> Human Gate -> explicit apply
19
+ ```
20
+
21
+ ## Comparison
22
+
23
+ | Pattern | Strong At | NEKOWORK Answer |
24
+ |---|---|---|
25
+ | Large agent catalog | Many roles, skills, and commands | Keep catalogs selective; make verification the product |
26
+ | Discipline workflow | TDD, planning, debugging, review method | Add `quality` profile, evidence policy, and strict quality gates |
27
+ | Team simulation | Many specialists thinking in parallel | Keep `team` read-only and preserve one executor for writes |
28
+ | Autopilot UX | Fast one-command execution | Use `run` as the compact safe wrapper: `work -> verify -> ship` |
29
+ | Cross-tool setup | Many harness surfaces | Project one source catalog into Claude, Codex, Cursor, Gemini, and OpenCode |
30
+
31
+ ## What NEKOWORK Optimizes For
32
+
33
+ - Local delegated auth, not static API keys by default.
34
+ - Inspectable session artifacts and handoffs.
35
+ - Read-only multi-agent thinking.
36
+ - Single-executor mutation.
37
+ - Independent Codex verification.
38
+ - Human Gate for risky changes.
39
+ - `apply` only after verified `SHIP_READY` live-work diffs.
40
+
41
+ ## What NEKOWORK Does Not Optimize For
42
+
43
+ - Being the largest agent catalog.
44
+ - Magic-keyword automatic activation.
45
+ - Bypassing review to maximize speed.
46
+ - Publishing, deploying, or pushing without human control.
47
+
48
+ ## Default Pitch
49
+
50
+ English:
51
+
52
+ ```text
53
+ NEKOWORK is a local-first AI development quality runtime.
54
+ It makes AI-generated changes prove themselves through independent verification,
55
+ Human Gate decisions, and explicit apply control.
56
+ ```
57
+
58
+ Korean:
59
+
60
+ ```text
61
+ NEKOWORK는 AI 개발을 위한 로컬 우선 품질 런타임입니다.
62
+ AI가 만든 변경을 독립 검증, Human Gate, 명시적 apply를 거쳐
63
+ 감사 가능한 변경으로 통과시킵니다.
64
+ ```
@@ -0,0 +1,16 @@
1
+ # Case Studies
2
+
3
+ This directory records NEKOWORK runs against real projects or production-like fixtures.
4
+
5
+ Case studies must keep the NEKOWORK invariants visible:
6
+
7
+ - no automatic publish, deploy, push, or PR
8
+ - read-only team or planning phases unless explicitly scoped
9
+ - one executor for write phases
10
+ - Codex verification before ship readiness
11
+ - Human Gate when risk policy requires it
12
+ - explicit apply only after verified readiness
13
+
14
+ ## Current Case Studies
15
+
16
+ - [sindresorhus/is-plain-obj](SINDRESORHUS-IS-PLAIN-OBJ.md): third-party public npm package, quality-profile run, strict quality no-ship evidence.
@@ -0,0 +1,141 @@
1
+ # Case Study: sindresorhus/is-plain-obj
2
+
3
+ Status date: 2026-05-07
4
+
5
+ Target repository:
6
+
7
+ ```text
8
+ https://github.com/sindresorhus/is-plain-obj
9
+ ```
10
+
11
+ Target commit:
12
+
13
+ ```text
14
+ 97f38e8836f86a642cce98fc6ab3058bc36df181
15
+ ```
16
+
17
+ Package:
18
+
19
+ ```text
20
+ is-plain-obj@4.1.0
21
+ license: MIT
22
+ purpose: Check if a value is a plain object
23
+ ```
24
+
25
+ ## Why This Target
26
+
27
+ This is a small third-party Node package with a clear public API, local tests, and a permissive license. It is useful as a first real external case study because the expected blast radius is small and the test command is explicit.
28
+
29
+ This case study does not create an upstream PR. It proves that NEKOWORK can run against a real external codebase, record session evidence, and refuse ship readiness when strict quality evidence is incomplete.
30
+
31
+ ## Commands Run
32
+
33
+ From a temporary clone of the target:
34
+
35
+ ```bash
36
+ git clone --depth=1 https://github.com/sindresorhus/is-plain-obj.git <target>
37
+ cd <target>
38
+ npm install
39
+ npm test
40
+ ```
41
+
42
+ From the NEKOWORK checkout:
43
+
44
+ ```bash
45
+ node scripts/cli.js doctor --quick --project-root <target> --json
46
+ node scripts/portability/simulate-port.js <target> --profile developer --json
47
+ node scripts/cli.js ask "assess is-plain-obj plain object boundary coverage" --profile quality --session nekowork-is-plain-obj-case --project-root <target> --json
48
+ node scripts/cli.js run "assess is-plain-obj plain object boundary coverage" --profile quality --strict-quality --session nekowork-is-plain-obj-case --project-root <target> --json
49
+ node scripts/cli.js gate status --session nekowork-is-plain-obj-case --project-root <target> --json
50
+ ```
51
+
52
+ ## Target Test Result
53
+
54
+ ```text
55
+ npm install
56
+ -> found 0 vulnerabilities
57
+
58
+ npm test
59
+ -> xo && ava && tsd
60
+ -> 1 test passed
61
+ ```
62
+
63
+ ## NEKOWORK Result
64
+
65
+ Doctor:
66
+
67
+ ```text
68
+ summary: WARN
69
+ pass: 6
70
+ warn: 1
71
+ fail: 0
72
+ warning: Gemini CLI auth was not checked non-interactively
73
+ ```
74
+
75
+ Portability preflight:
76
+
77
+ ```text
78
+ strategy: submodule
79
+ conflicts: none
80
+ profile: developer
81
+ component_count: 43
82
+ ```
83
+
84
+ Run summary:
85
+
86
+ ```json
87
+ {
88
+ "sessionId": "nekowork-is-plain-obj-case",
89
+ "profile": "quality",
90
+ "strict_quality": true,
91
+ "strict_quality_blocked": true,
92
+ "verify_verdict": "approve_with_fixes",
93
+ "ship_ready": false,
94
+ "no_ship": true,
95
+ "human_gate": false,
96
+ "apply_requested": false,
97
+ "applied": false,
98
+ "target_project_mutated": false
99
+ }
100
+ ```
101
+
102
+ Verify summary:
103
+
104
+ ```text
105
+ quality_warnings:
106
+ - AC-001 lacks explicit verification evidence
107
+ - AC-002 lacks explicit verification evidence
108
+ - AC-003 lacks explicit verification evidence
109
+
110
+ acceptance_coverage:
111
+ - AC-001: missing
112
+ - AC-002: missing
113
+ - AC-003: missing
114
+ ```
115
+
116
+ Gate status:
117
+
118
+ ```text
119
+ status: clear
120
+ humanGate: false
121
+ ```
122
+
123
+ Git status in the target after the run:
124
+
125
+ ```text
126
+ ?? .harness/
127
+ ```
128
+
129
+ Only NEKOWORK session evidence was written. No package source files were modified and no apply step was requested.
130
+
131
+ ## Interpretation
132
+
133
+ This is the expected safe result for a strict-quality external run using mock providers:
134
+
135
+ - The target project's own tests passed.
136
+ - NEKOWORK created inspectable evidence under `.harness/state/sessions/`.
137
+ - `strict-quality` refused ship readiness because acceptance evidence was not explicit enough.
138
+ - Human Gate was not required because the task was low risk.
139
+ - No target project source mutation, PR, publish, deploy, or apply occurred.
140
+
141
+ The value of this case study is not that NEKOWORK changed the package. The value is that NEKOWORK treated a real third-party project as a controlled target and produced a no-ship decision when quality evidence was incomplete.
@@ -0,0 +1,142 @@
1
+ # Dev-log — 2026-04-29 P1 회수 세션
2
+
3
+ > Week 1~4 마감 후 AUDIT 의 P1 항목 + 일부 P2 를 한 세션 (4 시간) 안에 회수.
4
+ > 본 문서는 사후 기록. 의사결정·발견된 이슈·다음 후속을 정리한다.
5
+
6
+ ## 1. 진입 상황
7
+
8
+ `docs/AUDIT.md` (2026-04-29 작성 시점) 기준 부채:
9
+
10
+ - 빈 디렉터리 6개: `docs/CODEMAPS/`, `rules/{common,typescript,python}/`, `tests/{integration,e2e}/`
11
+ - 미구현 스크립트 9개: `validate-{agents,skills,hooks,manifests}.js`, `build-{cursor,gemini,opencode}.js`, `sync-claude-md.js`, `repair.js`
12
+ - stub 메시지 흔적: `cli.js` / `mcp-server.js` / `pre-bash-dispatcher.js` / `daemon/wait.js` / `orchestrators/ralph.js` / `ci/catalog.js` 의 "Day N" 잔존
13
+ - `install-apply` 의 `source_sha256: "0".repeat(64)` placeholder
14
+ - ARCHITECTURE.md 가 stub (50줄, 18절 매핑만)
15
+
16
+ ## 2. 처리 순서 (실행 순)
17
+
18
+ | # | 항목 | 산출 | 시간(추정) |
19
+ |---|---|---|---|
20
+ | 1 | `scripts/sync-claude-md.js` | 마커 자동 갱신 + version 주입 + dry-run/check | 30분 |
21
+ | 2 | `scripts/repair.js` | install-state sha256 비교 + 변경분 재빌드 | 30분 |
22
+ | 3 | `scripts/build-{cursor,gemini,opencode}.js` | 3 빌더, 각 80~150줄 | 60분 |
23
+ | 4 | `scripts/ci/validate-{agents,skills,hooks,manifests}.js` | ajv + frontmatter + 그래프 무결성 | 30분 |
24
+ | 5 | `rules/{common,typescript,python}/` 콘텐츠 | 8 파일 (common 3 + ts 3 + py 2) | 60분 |
25
+ | 6 | `docs/ARCHITECTURE.md` 18절 본문 | 528줄, ASCII 다이어그램 + 8계층 + 라우팅 + Codex Loop + 12-item Bar | 60~90분 |
26
+ | 7 | stub 메시지 정리 | 6 파일에서 "Day N" 흔적 제거. `package.json` lint/test 실 매핑 | 10분 |
27
+ | 8 | `install-apply` sha256 실값화 | `sha256OfDir` + `sha256OfCatalog` 추가 | 20분 |
28
+ | 9 | `scripts/build-codemaps.js` (보너스) | 디렉터리 트리 + export 추출. 9 영역 자동 산출 | 60분 |
29
+ | 10 | `tests/integration/build-pipeline.test.js` | 격리 sandbox + 풀체인 10 케이스 | 60분 |
30
+ | 11 | `tests/e2e/review-cycle.test.js` | demo-review 시뮬 7 케이스 + CLI 검증 | 60~90분 |
31
+ | 12 | AUDIT 갱신 + dev-log 추가 | 본 문서 + AUDIT §1~5, §7, §8 갱신 | 30분 |
32
+
33
+ ## 3. 이번 세션의 의사결정
34
+
35
+ ### 3.1 "## 자동 갱신 영역" 헤딩과 마커 위치
36
+
37
+ 처음 sync-claude-md 실행 시 기존 CLAUDE.md 의 `## 빌드 후 확인` 블록이 마커 바깥(원본 상태)에 있던 것을 인지 못 하고 자동 영역에도 똑같이 생성 → 중복.
38
+
39
+ **결정**: 자동 영역에서 `## 빌드 후 확인` 빼고, 사용자 작성 영역으로 유지. 사유: 빌드 후 확인 명령은 카탈로그가 바뀌어도 안 바뀌는 정적 가이드. 자동 갱신 대상 아님.
40
+
41
+ ### 3.2 install-apply 의 5 빌더 일괄 실행
42
+
43
+ 기존 `install-apply.js` 는 `['claude', 'codex']` 하드코딩. 새 빌더 3개를 추가했지만 install 흐름이 안 잡으면 의미 없음.
44
+
45
+ **결정**: `agent.yaml.harnesses[].name` 을 그대로 사용. 매니페스트 단일 진실 원본 원칙과 일치.
46
+
47
+ ### 3.3 sha256 의 의미 분리
48
+
49
+ 스키마는 `source_sha256` 과 `targets[].sha256` 둘 다 정의. 둘의 의미가 다름.
50
+
51
+ **결정**:
52
+ - `source_sha256` = 카탈로그 입력 전체의 단일 해시 (`agent.yaml + agents/ + skills/ + commands/ + hooks/ + manifests/`). 모든 빌더에 동일.
53
+ - `targets[].sha256` = 출력 디렉터리 (`.claude/`, `.codex/`, ...) 의 해시. 빌더별로 다름.
54
+
55
+ repair 는 `targets[].sha256` 만 비교 (출력 변조 / 누락 검출).
56
+
57
+ ### 3.4 e2e 테스트의 "auth 자동 활성"
58
+
59
+ `demo-review.js` 는 `isAuthChange = true` 하드코딩. 따라서 항상 codex-challenge 활성.
60
+
61
+ **결정**: 회귀 안전성을 위해 본 동작을 명시 검증하는 케이스를 추가. 사양 변경(`isAuthChange` 가 진짜 path 검사로 바뀌면) 시 본 테스트가 알람.
62
+
63
+ ### 3.5 codemaps 의 보너스 추가
64
+
65
+ 원래 P2 였지만 build-codemaps 가 build-{claude,codex,...} 패턴과 동질 → 같은 세션 안에 끼워 넣음. 별도 npm 스크립트 (`npm run build:codemaps`) 만 추가, install 흐름엔 안 묶음 (선택적).
66
+
67
+ ## 4. 발견된 마찰
68
+
69
+ | 마찰 | 회수 방안 |
70
+ |---|---|
71
+ | sandbox 카피 시 `node_modules` symlink 권한 부족 가능 (Windows) | 폴백으로 cp. 첫 실행 느림 (~5초) — 수용. |
72
+ | `node --test tests/unit/` 디렉터리 호출 | 글로브 명시 (`tests/unit/*.test.js`) 로 우회. `npm test` 가 표준 진입점이 됨. |
73
+ | `read-only` 가 sandbox 영역인지 헷갈림 | agent frontmatter 의 `sandbox: read-only` 와 OS sandbox 는 별개. CLAUDE.md 에 주석 추가 필요 (다음 세션). |
74
+
75
+ ## 5. 검증
76
+
77
+ ```
78
+ node --test tests/unit/*.test.js tests/integration/*.test.js tests/e2e/*.test.js
79
+ → 73/73 PASS, duration ~3.4 s
80
+
81
+ npm run lint
82
+ → catalog + validate:all 모두 통과 (경고 4건은 사실, 오류 0)
83
+
84
+ node scripts/repair.js --check
85
+ → 모든 하네스 정합
86
+
87
+ node scripts/sync-claude-md.js --check
88
+ → CLAUDE.md 자동 영역 동기화 OK
89
+
90
+ node scripts/build-codemaps.js --check
91
+ → 모든 codemap 최신 상태
92
+ ```
93
+
94
+ ## 6. 다음 세션 진입 후보
95
+
96
+ `docs/AUDIT.md §5` 갱신본 참조. 요약:
97
+
98
+ - **P0** (사용자 동의 필요): Anthropic SDK live 1회, GitHub push, 사내 PoC 결합.
99
+ - **P2** (외부 의존): Rust 컴파일, Codex/Gemini CLI live 검증, GitHub Actions 실 동작.
100
+ - **P3** (사내 임팩트): 사용자 명시 사내 프로젝트에 풀 결합.
101
+
102
+ ## 7. 산출 파일 목록
103
+
104
+ ```
105
+ 신규
106
+ scripts/sync-claude-md.js
107
+ scripts/repair.js
108
+ scripts/build-cursor.js
109
+ scripts/build-gemini.js
110
+ scripts/build-opencode.js
111
+ scripts/build-codemaps.js
112
+ scripts/ci/validate-agents.js
113
+ scripts/ci/validate-skills.js
114
+ scripts/ci/validate-hooks.js
115
+ scripts/ci/validate-manifests.js
116
+ rules/common/coding-style.md
117
+ rules/common/testing.md
118
+ rules/common/security.md
119
+ rules/typescript/coding-style.md
120
+ rules/typescript/testing.md
121
+ rules/typescript/security.md
122
+ rules/python/coding-style.md
123
+ rules/python/testing.md
124
+ tests/integration/build-pipeline.test.js
125
+ tests/e2e/review-cycle.test.js
126
+ docs/CODEMAPS/{README,scripts,agents,skills,hooks,manifests,schemas,bridge,rules,tests}.md
127
+ docs/dev-log/2026-04-29-p1-recovery.md ← 본 문서
128
+
129
+ 수정
130
+ scripts/install-apply.js (5 빌더 + sha256 실값)
131
+ scripts/cli.js (Day N 메시지 정리)
132
+ scripts/ci/catalog.js (Day 2/3 흔적)
133
+ scripts/daemon/wait.js (Day 8/9 흔적)
134
+ scripts/orchestrators/ralph.js (Day 9 흔적)
135
+ bridge/mcp-server.js (Day 4/5 흔적)
136
+ hooks/scripts/pre-bash-dispatcher.js (Day 3/5 흔적)
137
+ package.json (lint/test 실 매핑 + test:* 분리 + build:codemaps)
138
+ CLAUDE.md (자동 영역 마커 정합 + 컨텐츠 갱신)
139
+ .claude/CLAUDE.md (동일)
140
+ docs/ARCHITECTURE.md (stub 50줄 → 풀 528줄)
141
+ docs/AUDIT.md (P1 회수 반영)
142
+ ```
@@ -0,0 +1,81 @@
1
+ # WORKING-CONTEXT
2
+
3
+ > 현재 스프린트의 액티브 메모리. 스프린트가 끝나면 archive 또는 docs 로 옮긴다. CHANGELOG 가 아니라 working memory.
4
+ > Last updated: 2026-04-29
5
+
6
+ ## Purpose
7
+
8
+ 차세대 통합 AI 개발 에이전트 하네스 HARNESS 의 부트스트랩. ECC + OMC + claude-led-codex-review 의 통합 설계를 코드로 옮긴다.
9
+
10
+ ## Current Truth
11
+
12
+ - Day 1 진행 중. 위치: `D:\claude\harness\`.
13
+ - 인접 사내 프로젝트는 다루지 않는다 (사용자 룰).
14
+ - 기술 스택: Node 22 + TypeScript strict, 추후 Rust(runtime/) TUI.
15
+ - 한국어 응답 강제. 사용자 글로벌 룰 우선.
16
+
17
+ ## Current Constraints
18
+
19
+ - 4시간 풀 사이클로 Day 1 완료 목표.
20
+ - MVP 카탈로그: 11 agents, 5 skills, 4 hooks, 6 modules.
21
+ - 184 스킬 풀 카탈로그 채택 안 함 (progressive 확장).
22
+ - tmux 기반 team 런타임은 Q2 (Windows 환경 마찰).
23
+
24
+ ## Active Queues
25
+
26
+ ### In Progress
27
+ - Day 1: 골격 + 거버넌스 + 매니페스트 + 스키마 + plan stub.
28
+
29
+ ### Next
30
+ - Day 2: agents/ 11 frontmatter, skills/claude-led-codex-review/SKILL.md, codex-reviewer 페르소나.
31
+ - Day 3: hooks/hooks.json + 4훅 stub, scripts/build-claude.js.
32
+ - Day 4: bridge/mcp-server.cjs 최소 4도구.
33
+ - Day 5: gateguard-fact-force + quality-gate 실 구현.
34
+
35
+ ## Open PR Classification
36
+
37
+ (없음 — Day 1)
38
+
39
+ ## Interfaces
40
+
41
+ - CLI: `harness <verb> <args>`
42
+ - MCP: `mcp__harness__<tool>` (단일 게이트웨이)
43
+ - Hooks: PreToolUse / PostToolUse / PreCompact / Stop / UserPromptSubmit / SessionStart
44
+
45
+ ## Update Rule
46
+
47
+ 이 파일은 **현재 스프린트만** 디테일하게 유지한다. 끝난 작업은 `docs/CHANGELOG.md` 로 옮긴다. 1주 이상 갱신 안 되면 archive 후보.
48
+
49
+ ## Latest Execution Notes
50
+
51
+ - 2026-04-29 **Week 1 풀 진행 완료**.
52
+ - Day 1: 골격 + 거버넌스 6 + agent.yaml + manifests + schemas 10 + install plan stub.
53
+ - Day 2: agents 11 + skills 5 + commands 1 (catalog warnings 0).
54
+ - Day 3: hooks 5 + build-claude (22 components) + build-codex (config.toml + TOML agents).
55
+ - Day 4: MCP gateway (4도구, smoke PASS) + install-apply 풀체인.
56
+ - Day 5: gateguard 실 (importer/exports 정적 추출 + 답변 강제), quality-gate 실 (tsc/ruff 차단), demo-review 7단계 풀사이클 검증.
57
+ - 통계: 66 파일, 6,765 LOC. 137 packages 의존성.
58
+ - 2026-04-29 **Day 6 완료**.
59
+ - 4 provider runner (mock/claude/codex/gemini) + dispatch + 7단계 orchestrator + cli wiring.
60
+ - mock 디폴트 (API 키 / Codex CLI 미보유 환경에서도 동작), --live 옵션으로 실 호출.
61
+ - sensitive path 자동 감지 (auth/crypto/payment/jwt 등) → 단계 6 자동 활성.
62
+ - round 한도 + critical 발견 → HUMAN_GATE 자동.
63
+ - node --test 5/5 PASS. harness review CLI 데모 OK.
64
+ - 2026-04-29 **Week 2 완료**.
65
+ - Day 7: lib/{severity,router,costs}.js + MCP 3 신규 도구 (severity_classify, route_decide, cost_record) + harness costs CLI + routing.jsonl 자동 적층.
66
+ - Day 8: skills/ralph/SKILL.md + scripts/orchestrators/ralph.js (PRD AC 누적 PASS) + scripts/daemon/wait.js (start/stop/status). 명시 옵트인만 (자동 키워드 활성 OFF).
67
+ - Day 9-10: .github/workflows/{harness-review,harness-validate}.yml + docs/PORTING.md (사내 PoC 이식 가이드).
68
+ - 단위 테스트 24/24 PASS. 83 파일. 풀체인 동작 (review / ralph / costs / sessions / wait).
69
+ - 2026-04-29 **Week 3 완료 (Day 11~15)**.
70
+ - Day 11: instincts 시스템 (record/list/promote/prune) + orchestrator 자동 누적 + CLI + 11/11 테스트.
71
+ - Day 12: simulate-port.js + 5/5 테스트 (외부 디렉터리 인용 제거).
72
+ - Day 13: claude/codex extractJson + buildPrompt export + 12/12 테스트.
73
+ - Day 14-15: CHANGELOG Week 3, WORKING-CONTEXT 갱신, 최종 회귀.
74
+ - 누적: 4 커밋, ~92 파일, ~10,500 LOC, 단위 테스트 52/52 PASS.
75
+ - 2026-04-29 **Week 4 완료 (Day 16~20)**.
76
+ - Day 16: instincts.ready() + CLI + 4 신규 단위 테스트 (15/15 PASS).
77
+ - Day 17-18: Rust runtime 골격 — Cargo.toml + 5 .rs 파일 (529 LOC, 컴파일은 rustup 설치 후).
78
+ - Day 19: 사용자 D 선택 — 외부 환경 변경 보류, AUDIT 집중.
79
+ - Day 20: docs/AUDIT.md — Week 1~4 통합 검토 (18절 매핑, 8계층 매핑, 빠진 항목 / 부채 / P0~P3 우선순위).
80
+ - 누적: 5 커밋 예정, ~100 파일, ~12,000 LOC, 단위 테스트 56/56 PASS.
81
+ - **세션 종료**. 다음 세션 P0: 실 LLM 호출 / PoC 결합 / GitHub push (사용자 명시 동의 시).