@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
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# GitHub Actions Hardening Example
|
|
2
|
+
|
|
3
|
+
This example shows how NEKOWORK handles deploy-sensitive CI workflow work.
|
|
4
|
+
|
|
5
|
+
The checked-in standalone target project lives at:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
examples/github-actions-hardening/
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
It includes a hardened validation workflow, a local YAML-based hardening check, and case-study artifacts under `case-study/`.
|
|
12
|
+
|
|
13
|
+
## Request
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
Harden a GitHub Actions validation workflow without adding deploy or publish behavior.
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Recommended Flow
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
node scripts/cli.js ask "harden GitHub Actions validation workflow" --session actions-hardening
|
|
23
|
+
node scripts/cli.js plan "harden GitHub Actions validation workflow" --session actions-hardening
|
|
24
|
+
node scripts/cli.js team "harden GitHub Actions validation workflow" --workers planner,security,test --no-write --session actions-hardening
|
|
25
|
+
node scripts/cli.js work "implement hardened GitHub Actions validation workflow" --single-executor --session actions-hardening
|
|
26
|
+
node scripts/cli.js verify "verify hardened GitHub Actions validation workflow" --secure --session actions-hardening
|
|
27
|
+
node scripts/cli.js gate status --session actions-hardening
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Expected Policy Behavior
|
|
31
|
+
|
|
32
|
+
The task should classify as:
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
risk=high
|
|
36
|
+
tags=deploy
|
|
37
|
+
requiresCodexChallenge=true
|
|
38
|
+
requiresHumanGate=true
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
That means:
|
|
42
|
+
|
|
43
|
+
- `ask` confirms deploy/publish/cloud credentials are out of scope.
|
|
44
|
+
- `team` remains read-only.
|
|
45
|
+
- `work` uses one executor and records acceptance criteria.
|
|
46
|
+
- `verify --secure` runs Codex review and Codex challenge.
|
|
47
|
+
- `ship` stays blocked until the human explicitly approves or blocks.
|
|
48
|
+
|
|
49
|
+
## Local Evidence
|
|
50
|
+
|
|
51
|
+
Inside the example project:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm test
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Expected output:
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
github-actions-hardening checks passed
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The local check verifies:
|
|
64
|
+
|
|
65
|
+
- no `pull_request_target`
|
|
66
|
+
- no package publish
|
|
67
|
+
- no static secrets
|
|
68
|
+
- no cloud credential setup
|
|
69
|
+
- read-only permissions
|
|
70
|
+
- pinned non-floating action refs
|
|
71
|
+
- bounded job timeout
|
|
72
|
+
|
|
73
|
+
## Example Gate Resolution
|
|
74
|
+
|
|
75
|
+
Approve only after confirming the workflow remains validation-only:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
node scripts/cli.js gate approve --session actions-hardening --reason "Confirmed validation-only hardened workflow."
|
|
79
|
+
node scripts/cli.js ship "prepare GitHub Actions hardening ship readiness" --require-clean-gates --session actions-hardening
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
If deploy, publish, or broad permission behavior appears:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
node scripts/cli.js gate block --session actions-hardening --reason "Workflow hardening boundary is not proven."
|
|
86
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Quality Lifecycle Smoke
|
|
2
|
+
|
|
3
|
+
`examples/quality-lifecycle-smoke` is a small case-study target for the NEKOWORK quality profile.
|
|
4
|
+
|
|
5
|
+
It demonstrates this path:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
ask --profile quality
|
|
9
|
+
-> plan
|
|
10
|
+
-> team
|
|
11
|
+
-> work --profile quality
|
|
12
|
+
-> verify --profile quality --strict-quality
|
|
13
|
+
-> ship
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The example is intentionally small. Its purpose is to show the quality-runtime evidence shape:
|
|
17
|
+
|
|
18
|
+
- `ask` records quality questions and the quality checklist.
|
|
19
|
+
- `work` remains single-executor.
|
|
20
|
+
- `verify` requires evidence-based findings for high/critical issues.
|
|
21
|
+
- `verify-summary.json` can carry structured `acceptance_coverage`.
|
|
22
|
+
- `--strict-quality` can convert unresolved quality warnings into a fix-required verification verdict.
|
|
23
|
+
- `ship` remains readiness only; `apply` is still explicit.
|
|
24
|
+
|
|
25
|
+
Run the local check:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
cd examples/quality-lifecycle-smoke
|
|
29
|
+
npm test
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
This example is not a substitute for a named third-party external project case study. It is a checked-in fixture that proves the quality lifecycle contract is inspectable.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Trading Dashboard Mock Example
|
|
2
|
+
|
|
3
|
+
This example shows how NEKOWORK handles a financial UI request without treating it like a normal low-risk mockup.
|
|
4
|
+
|
|
5
|
+
The checked-in standalone target project lives at:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
examples/trading-dashboard-mock/
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
It includes a static dashboard, local fixture data, a zero-dependency mock-boundary test, and case-study artifacts under `case-study/`.
|
|
12
|
+
|
|
13
|
+
## Request
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
Build a trading dashboard mockup. It must use mock data only and must not place real orders.
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Recommended Flow
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
node scripts/cli.js ask "stock trading dashboard mockup with mock-only orders" --session trading-demo
|
|
23
|
+
node scripts/cli.js plan "stock trading dashboard mockup with mock-only orders" --session trading-demo
|
|
24
|
+
node scripts/cli.js team "stock trading dashboard mockup with mock-only orders" --workers planner,product,security,test --no-write --session trading-demo
|
|
25
|
+
node scripts/cli.js work "implement the planned trading dashboard mockup" --single-executor --session trading-demo
|
|
26
|
+
node scripts/cli.js verify "verify the trading dashboard mockup stays mock-only" --session trading-demo
|
|
27
|
+
node scripts/cli.js gate status --session trading-demo
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Expected Policy Behavior
|
|
31
|
+
|
|
32
|
+
The task should classify as:
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
risk=high
|
|
36
|
+
tags=financial,product-ui
|
|
37
|
+
requiresCodexChallenge=true
|
|
38
|
+
requiresHumanGate=true
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
That means:
|
|
42
|
+
|
|
43
|
+
- `ask` asks whether all broker/order/payment behavior must stay mock-only.
|
|
44
|
+
- `team` remains read-only.
|
|
45
|
+
- `work` uses one executor and records acceptance criteria.
|
|
46
|
+
- `verify` runs Codex review and Codex challenge.
|
|
47
|
+
- `verify` writes `HUMAN_GATE` even if Codex approves, because financial automation needs human confirmation.
|
|
48
|
+
- `ship` stays blocked until the human explicitly approves or blocks.
|
|
49
|
+
|
|
50
|
+
## Example Gate Resolution
|
|
51
|
+
|
|
52
|
+
Approve only after confirming that no real broker, payment, order, or account code is present:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
node scripts/cli.js gate approve --session trading-demo --reason "Confirmed mock-only data and no real order execution."
|
|
56
|
+
node scripts/cli.js ship "prepare trading dashboard mock ship readiness" --require-clean-gates --session trading-demo
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
If any real-money behavior is present:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
node scripts/cli.js gate block --session trading-demo --reason "Real order/payment behavior is not allowed in this mock cycle."
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`apply` remains separate and should only run after `SHIP_READY` exists for a live-work diff.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Workflows Stash
|
|
2
|
+
|
|
3
|
+
> 첫 push 당시 OAuth 토큰의 `workflow` 스코프 부족으로 `.github/workflows/` 가 reject 되어 임시 보관소.
|
|
4
|
+
> 정책상 본 디렉터리는 일시적이며, 토큰 갱신 또는 웹 UI 업로드 후 본 디렉터리는 삭제할 수 있다.
|
|
5
|
+
|
|
6
|
+
## 재 등록 절차 (택일)
|
|
7
|
+
|
|
8
|
+
### A. GitHub 웹 UI 업로드 (가장 단순)
|
|
9
|
+
|
|
10
|
+
1. https://github.com/Ps-Neko/NEKOWORK 접속
|
|
11
|
+
2. `Add file` → `Create new file`
|
|
12
|
+
3. 파일명: `.github/workflows/harness-review.yml`
|
|
13
|
+
4. 내용: 본 디렉터리의 `harness-review.yml` 그대로 복사 / 붙여넣기
|
|
14
|
+
5. Commit (직접 main 또는 PR)
|
|
15
|
+
6. `harness-validate.yml` 도 동일
|
|
16
|
+
|
|
17
|
+
### B. 토큰 갱신 후 push
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
gh auth refresh -s workflow # 브라우저 동의 필요
|
|
21
|
+
mkdir -p .github/workflows
|
|
22
|
+
cp docs/workflows-stash/harness-review.yml .github/workflows/
|
|
23
|
+
cp docs/workflows-stash/harness-validate.yml .github/workflows/
|
|
24
|
+
git add .github/workflows/
|
|
25
|
+
git commit -m "ci: GitHub Actions 복원"
|
|
26
|
+
git push
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 무엇이 보관됐나
|
|
30
|
+
|
|
31
|
+
- `harness-review.yml` — PR 자동 7단계 + 핸드오프 PR 코멘트 + 아티팩트 업로드
|
|
32
|
+
- `harness-validate.yml` — push/PR 시 매니페스트 + 단위 테스트
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
name: harness-review
|
|
2
|
+
|
|
3
|
+
# claude-led-codex-review 7단계 풀사이클을 PR 에 자동 적용.
|
|
4
|
+
# - dry-run (mock provider) 디폴트: API 키 / Codex CLI 미설정 환경에서도 동작
|
|
5
|
+
# - live 는 self-hosted CLI 세션 또는 HARNESS_CLAUDE_RUNNER=sdk + secret opt-in 일 때만 사용
|
|
6
|
+
# - sensitive path 자동 감지 → --secure
|
|
7
|
+
# - critical 발견 / round ≥ 3 → 워크플로우 실패 + PR 코멘트
|
|
8
|
+
|
|
9
|
+
on:
|
|
10
|
+
pull_request:
|
|
11
|
+
types: [opened, synchronize, reopened]
|
|
12
|
+
workflow_dispatch:
|
|
13
|
+
inputs:
|
|
14
|
+
task:
|
|
15
|
+
description: '리뷰 task 설명'
|
|
16
|
+
required: false
|
|
17
|
+
default: ''
|
|
18
|
+
secure:
|
|
19
|
+
description: '단계 6 codex-challenge 강제'
|
|
20
|
+
required: false
|
|
21
|
+
default: 'auto'
|
|
22
|
+
type: choice
|
|
23
|
+
options: [auto, on, off]
|
|
24
|
+
live:
|
|
25
|
+
description: '실 LLM 호출 (시크릿 필요)'
|
|
26
|
+
required: false
|
|
27
|
+
default: 'false'
|
|
28
|
+
type: choice
|
|
29
|
+
options: ['false', 'true']
|
|
30
|
+
|
|
31
|
+
permissions:
|
|
32
|
+
contents: read
|
|
33
|
+
pull-requests: write
|
|
34
|
+
|
|
35
|
+
jobs:
|
|
36
|
+
review:
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
timeout-minutes: 20
|
|
39
|
+
|
|
40
|
+
env:
|
|
41
|
+
HARNESS_HOOK_GATEGUARD: '1'
|
|
42
|
+
HARNESS_HOOK_QUALITY_GATE: '1'
|
|
43
|
+
HARNESS_HOOK_PRE_BASH: '0' # CI 에서는 bash 게이트 사용 안 함
|
|
44
|
+
HARNESS_HOOK_PERSISTENT_MODE: '0' # CI 에서는 영속 모드 OFF
|
|
45
|
+
|
|
46
|
+
steps:
|
|
47
|
+
- name: Checkout (full history)
|
|
48
|
+
uses: actions/checkout@v5
|
|
49
|
+
with:
|
|
50
|
+
fetch-depth: 0
|
|
51
|
+
|
|
52
|
+
- name: Setup Node 22
|
|
53
|
+
uses: actions/setup-node@v6
|
|
54
|
+
with:
|
|
55
|
+
node-version: '22'
|
|
56
|
+
cache: 'npm'
|
|
57
|
+
|
|
58
|
+
- name: npm install
|
|
59
|
+
run: npm ci --no-audit --no-fund
|
|
60
|
+
|
|
61
|
+
- name: Validate catalog
|
|
62
|
+
run: |
|
|
63
|
+
node scripts/install-plan.js --profile core --verbose
|
|
64
|
+
node scripts/ci/catalog.js
|
|
65
|
+
node scripts/ci/check-markers.js
|
|
66
|
+
|
|
67
|
+
- name: Compute task / secure / live
|
|
68
|
+
id: opts
|
|
69
|
+
run: |
|
|
70
|
+
TASK="${{ github.event.inputs.task }}"
|
|
71
|
+
if [ -z "$TASK" ] && [ -n "${{ github.event.pull_request.title }}" ]; then
|
|
72
|
+
TASK="${{ github.event.pull_request.title }}"
|
|
73
|
+
fi
|
|
74
|
+
if [ -z "$TASK" ]; then
|
|
75
|
+
TASK="자동: ${{ github.event_name }} ${{ github.ref }}"
|
|
76
|
+
fi
|
|
77
|
+
echo "task=$TASK" >> "$GITHUB_OUTPUT"
|
|
78
|
+
|
|
79
|
+
SECURE="${{ github.event.inputs.secure || 'auto' }}"
|
|
80
|
+
SECURE_FLAG=""
|
|
81
|
+
if [ "$SECURE" = "on" ]; then SECURE_FLAG="--secure"; fi
|
|
82
|
+
# auto: orchestrator 가 sensitive path 자동 감지
|
|
83
|
+
echo "secure_flag=$SECURE_FLAG" >> "$GITHUB_OUTPUT"
|
|
84
|
+
|
|
85
|
+
LIVE="${{ github.event.inputs.live || 'false' }}"
|
|
86
|
+
LIVE_FLAG=""
|
|
87
|
+
if [ "$LIVE" = "true" ] && [ -n "${{ secrets.ANTHROPIC_API_KEY }}" ]; then
|
|
88
|
+
LIVE_FLAG="--live"
|
|
89
|
+
fi
|
|
90
|
+
echo "live_flag=$LIVE_FLAG" >> "$GITHUB_OUTPUT"
|
|
91
|
+
|
|
92
|
+
- name: Run review
|
|
93
|
+
id: review
|
|
94
|
+
env:
|
|
95
|
+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
96
|
+
HARNESS_CLAUDE_RUNNER: ${{ steps.opts.outputs.live_flag && 'sdk' || '' }}
|
|
97
|
+
run: |
|
|
98
|
+
set +e
|
|
99
|
+
node scripts/cli.js review "${{ steps.opts.outputs.task }}" \
|
|
100
|
+
${{ steps.opts.outputs.secure_flag }} \
|
|
101
|
+
${{ steps.opts.outputs.live_flag }} \
|
|
102
|
+
--no-ship \
|
|
103
|
+
--session "ci-${{ github.run_id }}-${{ github.run_attempt }}"
|
|
104
|
+
CODE=$?
|
|
105
|
+
echo "exit=$CODE" >> "$GITHUB_OUTPUT"
|
|
106
|
+
# exit 3 = HUMAN_GATE
|
|
107
|
+
# 그 외 0 외 코드는 일반 실패
|
|
108
|
+
if [ "$CODE" = "0" ]; then echo "verdict=approve" >> "$GITHUB_OUTPUT";
|
|
109
|
+
elif [ "$CODE" = "3" ]; then echo "verdict=human_gate" >> "$GITHUB_OUTPUT";
|
|
110
|
+
else echo "verdict=error" >> "$GITHUB_OUTPUT"; fi
|
|
111
|
+
exit 0
|
|
112
|
+
|
|
113
|
+
- name: Collect handoffs
|
|
114
|
+
if: always()
|
|
115
|
+
run: |
|
|
116
|
+
SESSION_DIR=".harness/state/sessions/ci-${{ github.run_id }}-${{ github.run_attempt }}"
|
|
117
|
+
if [ -d "$SESSION_DIR/handoffs" ]; then
|
|
118
|
+
echo "## Handoffs"
|
|
119
|
+
ls "$SESSION_DIR/handoffs"
|
|
120
|
+
echo ""
|
|
121
|
+
for f in "$SESSION_DIR"/handoffs/*.md; do
|
|
122
|
+
echo "----"
|
|
123
|
+
cat "$f"
|
|
124
|
+
done > /tmp/handoffs.md
|
|
125
|
+
fi
|
|
126
|
+
|
|
127
|
+
- name: Upload artifacts
|
|
128
|
+
if: always()
|
|
129
|
+
uses: actions/upload-artifact@v6
|
|
130
|
+
with:
|
|
131
|
+
name: harness-handoffs-${{ github.run_id }}
|
|
132
|
+
path: .harness/state/sessions/ci-${{ github.run_id }}-*/
|
|
133
|
+
retention-days: 14
|
|
134
|
+
|
|
135
|
+
- name: Comment on PR
|
|
136
|
+
if: github.event_name == 'pull_request'
|
|
137
|
+
uses: actions/github-script@v8
|
|
138
|
+
with:
|
|
139
|
+
script: |
|
|
140
|
+
const fs = require('fs');
|
|
141
|
+
const sessionDir = `.harness/state/sessions/ci-${context.runId}-${context.runAttempt}`;
|
|
142
|
+
let body = `### HARNESS review (${{ steps.review.outputs.verdict }})\n\n`;
|
|
143
|
+
body += `세션: \`ci-${context.runId}-${context.runAttempt}\`\n`;
|
|
144
|
+
body += `exit: \`${{ steps.review.outputs.exit }}\`\n\n`;
|
|
145
|
+
try {
|
|
146
|
+
const handoffs = fs.readdirSync(`${sessionDir}/handoffs`).filter(f => f.endsWith('.md')).sort();
|
|
147
|
+
body += `핸드오프 ${handoffs.length}개:\n`;
|
|
148
|
+
for (const f of handoffs) body += `- \`${f}\`\n`;
|
|
149
|
+
const last = handoffs.filter(f => f.includes('codex-review') || f.includes('codex-challenge')).pop();
|
|
150
|
+
if (last) {
|
|
151
|
+
const text = fs.readFileSync(`${sessionDir}/handoffs/${last}`, 'utf8');
|
|
152
|
+
body += `\n<details><summary>${last}</summary>\n\n${text}\n</details>\n`;
|
|
153
|
+
}
|
|
154
|
+
} catch (e) { body += `(핸드오프 디렉터리 없음: ${e.message})\n`; }
|
|
155
|
+
github.rest.issues.createComment({
|
|
156
|
+
issue_number: context.issue.number,
|
|
157
|
+
owner: context.repo.owner,
|
|
158
|
+
repo: context.repo.repo,
|
|
159
|
+
body,
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
- name: Fail on human gate / error
|
|
163
|
+
if: steps.review.outputs.verdict != 'approve'
|
|
164
|
+
run: |
|
|
165
|
+
echo "review verdict: ${{ steps.review.outputs.verdict }}"
|
|
166
|
+
exit 1
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: harness-validate
|
|
2
|
+
|
|
3
|
+
# 매 push / PR 마다 매니페스트·카탈로그·테스트 빠른 검증. 5분 이내 완료 목표.
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
validate:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
timeout-minutes: 10
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v5
|
|
18
|
+
- uses: actions/setup-node@v6
|
|
19
|
+
with:
|
|
20
|
+
node-version: '22'
|
|
21
|
+
cache: 'npm'
|
|
22
|
+
- run: npm ci --no-audit --no-fund
|
|
23
|
+
|
|
24
|
+
- name: 매니페스트·카탈로그 검증
|
|
25
|
+
run: |
|
|
26
|
+
node scripts/install-plan.js --profile core --verbose
|
|
27
|
+
node scripts/install-plan.js --profile developer
|
|
28
|
+
node scripts/install-plan.js --profile security
|
|
29
|
+
node scripts/install-plan.js --profile research
|
|
30
|
+
node scripts/install-plan.js --profile full
|
|
31
|
+
node scripts/ci/catalog.js
|
|
32
|
+
node scripts/ci/check-markers.js
|
|
33
|
+
|
|
34
|
+
- name: 단위 테스트
|
|
35
|
+
run: |
|
|
36
|
+
npm test
|
|
37
|
+
|
|
38
|
+
- name: 의존성 감사
|
|
39
|
+
run: npm audit --audit-level=moderate
|
|
40
|
+
|
|
41
|
+
- name: 빌드 산출물
|
|
42
|
+
run: |
|
|
43
|
+
node scripts/build-claude.js
|
|
44
|
+
node scripts/build-codex.js
|
|
45
|
+
node scripts/build-cursor.js
|
|
46
|
+
node scripts/build-gemini.js
|
|
47
|
+
node scripts/build-opencode.js
|
|
48
|
+
node scripts/build-codemaps.js --check
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: hardened-validate
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [main]
|
|
6
|
+
push:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: hardened-validate-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
validate:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
timeout-minutes: 10
|
|
20
|
+
permissions:
|
|
21
|
+
contents: read
|
|
22
|
+
actions: read
|
|
23
|
+
steps:
|
|
24
|
+
- name: Checkout
|
|
25
|
+
uses: actions/checkout@v4
|
|
26
|
+
with:
|
|
27
|
+
persist-credentials: false
|
|
28
|
+
|
|
29
|
+
- name: Setup Node
|
|
30
|
+
uses: actions/setup-node@v4
|
|
31
|
+
with:
|
|
32
|
+
node-version: '22'
|
|
33
|
+
|
|
34
|
+
- name: Install
|
|
35
|
+
run: npm ci
|
|
36
|
+
|
|
37
|
+
- name: Test
|
|
38
|
+
run: npm test
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# GitHub Actions Hardening Project
|
|
2
|
+
|
|
3
|
+
This is a small standalone repository fixture used as a NEKOWORK case-study target.
|
|
4
|
+
|
|
5
|
+
It demonstrates a hardened CI workflow:
|
|
6
|
+
|
|
7
|
+
- read-only default token permissions
|
|
8
|
+
- explicit job permissions
|
|
9
|
+
- pinned action versions
|
|
10
|
+
- no `pull_request_target`
|
|
11
|
+
- no deploy or publish step
|
|
12
|
+
- job timeout
|
|
13
|
+
- no static cloud credentials
|
|
14
|
+
|
|
15
|
+
## Test
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm test
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The test verifies the workflow hardening boundary.
|
|
22
|
+
|
|
23
|
+
## NEKOWORK Case Study
|
|
24
|
+
|
|
25
|
+
See [case-study/TASK.md](case-study/TASK.md) for the workflow evidence:
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
ask -> plan -> team -> work -> verify -> gate -> ship
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The important product rule is that CI/security changes are deploy-sensitive. They require Codex verification and may require Human Gate before ship readiness.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Ask
|
|
2
|
+
|
|
3
|
+
Expected question-gate outcome:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
risk=high
|
|
7
|
+
tags=deploy
|
|
8
|
+
requiresCodexChallenge=true
|
|
9
|
+
requiresHumanGate=true
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Blocking Questions
|
|
13
|
+
|
|
14
|
+
1. Is this workflow allowed to deploy or publish?
|
|
15
|
+
2. What token permissions are required?
|
|
16
|
+
3. Are cloud credentials or repository secrets in scope?
|
|
17
|
+
4. Which event triggers are allowed?
|
|
18
|
+
5. What evidence proves the workflow is hardened?
|
|
19
|
+
|
|
20
|
+
## Draft Success Criteria
|
|
21
|
+
|
|
22
|
+
1. Workflow uses read-only default permissions.
|
|
23
|
+
2. Jobs use the minimum explicit permissions required.
|
|
24
|
+
3. Actions use pinned non-floating refs.
|
|
25
|
+
4. Workflow avoids `pull_request_target`, secrets, deploy, and publish behavior.
|
|
26
|
+
5. Local check validates the hardening boundary.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Gate Status
|
|
2
|
+
|
|
3
|
+
## Expected Status Before Approval
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
status=open
|
|
7
|
+
reason=risk policy requires human gate (deploy)
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Human Review Checklist
|
|
11
|
+
|
|
12
|
+
- Workflow does not deploy or publish.
|
|
13
|
+
- Permissions are read-only.
|
|
14
|
+
- Action refs are pinned and non-floating.
|
|
15
|
+
- No secrets or cloud credential setup exists.
|
|
16
|
+
- Local hardening check passes.
|
|
17
|
+
|
|
18
|
+
## Approve Command
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
node ../../scripts/cli.js gate approve --project-root . --session actions-hardening --reason "Confirmed validation-only hardened workflow."
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Block Command
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
node ../../scripts/cli.js gate block --project-root . --session actions-hardening --reason "Workflow hardening boundary is not proven."
|
|
28
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Plan
|
|
2
|
+
|
|
3
|
+
## Implementation
|
|
4
|
+
|
|
5
|
+
1. Add `.github/workflows/hardened-validate.yml`.
|
|
6
|
+
2. Use `push` and `pull_request` events only.
|
|
7
|
+
3. Set top-level `permissions: contents: read`.
|
|
8
|
+
4. Set explicit job permissions.
|
|
9
|
+
5. Use pinned action versions.
|
|
10
|
+
6. Disable checkout credential persistence.
|
|
11
|
+
7. Add a local `scripts/check.mjs` hardening validator.
|
|
12
|
+
|
|
13
|
+
## Acceptance Criteria
|
|
14
|
+
|
|
15
|
+
| ID | Criteria |
|
|
16
|
+
|---|---|
|
|
17
|
+
| AC-001 | Workflow validates on push and pull request only. |
|
|
18
|
+
| AC-002 | Top-level and job permissions are read-only. |
|
|
19
|
+
| AC-003 | Actions avoid floating refs. |
|
|
20
|
+
| AC-004 | No secrets, cloud credentials, deploy, or publish steps exist. |
|
|
21
|
+
| AC-005 | `npm test` validates the workflow boundary. |
|
|
22
|
+
|
|
23
|
+
## Human Gate
|
|
24
|
+
|
|
25
|
+
Human approval is required before claiming ship readiness because CI workflow changes can affect release, deploy, and repository trust boundaries.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Ship Ready
|
|
2
|
+
|
|
3
|
+
This case study is ship-ready only after Human Gate approval.
|
|
4
|
+
|
|
5
|
+
## Required Evidence
|
|
6
|
+
|
|
7
|
+
- Work handoff exists.
|
|
8
|
+
- Codex verification exists.
|
|
9
|
+
- Risk policy was evaluated.
|
|
10
|
+
- Human Gate was approved.
|
|
11
|
+
- `npm test` passed inside this fixture.
|
|
12
|
+
|
|
13
|
+
## Ship Command
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
node ../../scripts/cli.js ship "prepare GitHub Actions hardening ship readiness" --project-root . --session actions-hardening --require-clean-gates
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Apply Policy
|
|
20
|
+
|
|
21
|
+
This fixture is already present in the repository. In a live-work session, `apply` would remain explicit and would require `SHIP_READY`.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Task
|
|
2
|
+
|
|
3
|
+
Harden a GitHub Actions validation workflow without adding deploy or publish behavior.
|
|
4
|
+
|
|
5
|
+
## Scope
|
|
6
|
+
|
|
7
|
+
- Create a minimal CI workflow.
|
|
8
|
+
- Restrict GitHub token permissions.
|
|
9
|
+
- Pin action versions.
|
|
10
|
+
- Add a job timeout.
|
|
11
|
+
- Avoid secret, cloud credential, release, or deploy steps.
|
|
12
|
+
|
|
13
|
+
## Non-Goals
|
|
14
|
+
|
|
15
|
+
- No production deploy.
|
|
16
|
+
- No package publish.
|
|
17
|
+
- No cloud credential setup.
|
|
18
|
+
- No `pull_request_target`.
|
|
19
|
+
- No write-scoped token permissions.
|
|
20
|
+
|
|
21
|
+
## Recommended NEKOWORK Flow
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
node ../../scripts/cli.js ask "harden GitHub Actions validation workflow" --project-root . --session actions-hardening
|
|
25
|
+
node ../../scripts/cli.js plan "harden GitHub Actions validation workflow" --project-root . --session actions-hardening
|
|
26
|
+
node ../../scripts/cli.js team "harden GitHub Actions validation workflow" --workers planner,security,test --no-write --project-root . --session actions-hardening
|
|
27
|
+
node ../../scripts/cli.js work "implement hardened GitHub Actions validation workflow" --single-executor --project-root . --session actions-hardening
|
|
28
|
+
node ../../scripts/cli.js verify "verify hardened GitHub Actions validation workflow" --secure --project-root . --session actions-hardening
|
|
29
|
+
node ../../scripts/cli.js gate status --project-root . --session actions-hardening
|
|
30
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Team Handoffs
|
|
2
|
+
|
|
3
|
+
## Planner
|
|
4
|
+
|
|
5
|
+
Decided: Keep the workflow narrow: install and test only.
|
|
6
|
+
|
|
7
|
+
Rejected: Release, deploy, publish, cache mutation, and environment promotion.
|
|
8
|
+
|
|
9
|
+
Risks: CI workflows can accidentally grant token write scope or expose secrets.
|
|
10
|
+
|
|
11
|
+
Files: `.github/workflows/hardened-validate.yml`, `scripts/check.mjs`
|
|
12
|
+
|
|
13
|
+
Remaining: Verify permissions and action refs.
|
|
14
|
+
|
|
15
|
+
## Security
|
|
16
|
+
|
|
17
|
+
Decided: Use read-only permissions, no secrets, no cloud credentials, and no `pull_request_target`.
|
|
18
|
+
|
|
19
|
+
Rejected: Static cloud secrets, broad token scopes, floating action refs.
|
|
20
|
+
|
|
21
|
+
Risks: Future edits may add `id-token: write`, `contents: write`, or secret access.
|
|
22
|
+
|
|
23
|
+
Files: `.github/workflows/hardened-validate.yml`, `scripts/check.mjs`
|
|
24
|
+
|
|
25
|
+
Remaining: Human Gate stays required for deploy-sensitive workflow changes.
|
|
26
|
+
|
|
27
|
+
## Test
|
|
28
|
+
|
|
29
|
+
Decided: Use a local YAML parser check to validate the workflow contract.
|
|
30
|
+
|
|
31
|
+
Rejected: Live GitHub Actions execution for this small case-study fixture.
|
|
32
|
+
|
|
33
|
+
Risks: Static checks do not prove every marketplace action's internals.
|
|
34
|
+
|
|
35
|
+
Files: `scripts/check.mjs`, `package.json`
|
|
36
|
+
|
|
37
|
+
Remaining: Run `npm test`.
|