shipgate-cli 0.0.0-stage → 0.2.2
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/LICENSE +21 -0
- package/README.md +261 -2
- package/agents/context-builder.md +158 -0
- package/agents/debug-executor.md +234 -0
- package/assets/gates/classifier.js +245 -0
- package/assets/gates/dsh/index.js +767 -0
- package/assets/gates/dsh/policy.json +93 -0
- package/assets/gates/index.js +3 -0
- package/assets/gates/pi/index.js +1131 -0
- package/assets/gates/pi/policy.json +93 -0
- package/assets/gates/policy.js +4267 -0
- package/assets/gates/profiles/ai4s-dry-lab.json +64 -0
- package/assets/gates/profiles/ai4s-quant.json +36 -0
- package/assets/pi-extensions/auto-continue.ts +176 -0
- package/assets/pi-extensions/goal-mode.ts +313 -0
- package/bin/shipgate.mjs +9 -0
- package/commands/ai-spec.md +9 -0
- package/commands/api-first.md +33 -0
- package/commands/code-review.md +7 -0
- package/commands/codebase-context.md +19 -0
- package/commands/debug-ui.md +147 -0
- package/commands/debug.md +101 -0
- package/commands/dev-env-scan.md +18 -0
- package/commands/dev-host-init.md +28 -0
- package/commands/discover-skill-opportunities.md +33 -0
- package/commands/fork-sync.md +17 -0
- package/commands/gh-actions.md +26 -0
- package/commands/goal-driven-development.md +7 -0
- package/commands/intent-grill.md +7 -0
- package/commands/iteration-manager.md +7 -0
- package/commands/loop-engineer.md +21 -0
- package/commands/nodejs-npm-auto-release.md +12 -0
- package/commands/prd.md +7 -0
- package/commands/project-health-audit.md +7 -0
- package/commands/ralph-yolo.md +346 -0
- package/commands/ralph.md +226 -0
- package/commands/security-audit.md +7 -0
- package/commands/ux-experience-audit.md +133 -0
- package/docs/ARCHITECTURE.md +63 -0
- package/docs/GATES.md +106 -0
- package/docs/HARNESS.md +257 -0
- package/package.json +48 -4
- package/references/ADR-FORMAT.md +67 -0
- package/references/CONTEXT-FORMAT.md +62 -0
- package/references/mcp-config-template.json +54 -0
- package/scripts/fix-skill-frontmatter.mjs +66 -0
- package/scripts/migrate-skillpack.mjs +257 -0
- package/skills/ai-spec/SKILL.md +90 -0
- package/skills/api-first-modular/SKILL.md +411 -0
- package/skills/code-debugger/SKILL.md +379 -0
- package/skills/code-review/SKILL.md +62 -0
- package/skills/codebase-context/SKILL.md +139 -0
- package/skills/debug-ui/SKILL.md +220 -0
- package/skills/dev-env-scan/SKILL.md +147 -0
- package/skills/dev-host-init/SKILL.md +198 -0
- package/skills/dev-host-init/scripts/fill-placeholders.py +226 -0
- package/skills/dev-host-init/scripts/host-scan.ps1 +159 -0
- package/skills/dev-host-init/scripts/host-scan.sh +201 -0
- package/skills/dev-host-init/scripts/render-now.py +488 -0
- package/skills/dev-host-init/scripts/tools-catalog.py +229 -0
- package/skills/dev-host-init/templates/graph-first-gate.ts +291 -0
- package/skills/dev-host-init/templates/host-injection.template.md +725 -0
- package/skills/discover-skill-opportunities/SKILL.md +145 -0
- package/skills/discover-skill-opportunities/references/accounting-finance-ops.md +24 -0
- package/skills/discover-skill-opportunities/references/business-consulting.md +24 -0
- package/skills/discover-skill-opportunities/references/evidence-and-privacy.md +39 -0
- package/skills/discover-skill-opportunities/references/finance-investment.md +24 -0
- package/skills/discover-skill-opportunities/references/legal-and-compliance.md +24 -0
- package/skills/discover-skill-opportunities/references/output-contract.md +75 -0
- package/skills/discover-skill-opportunities/references/product-and-operations.md +24 -0
- package/skills/discover-skill-opportunities/references/quant-trading.md +24 -0
- package/skills/discover-skill-opportunities/references/scientific-research.md +24 -0
- package/skills/discover-skill-opportunities/references/scoring-rubric.md +45 -0
- package/skills/discover-skill-opportunities/references/session-skill-review.md +78 -0
- package/skills/discover-skill-opportunities/references/software-development.md +24 -0
- package/skills/fork-sync/SKILL.md +86 -0
- package/skills/gh-actions-architect/SKILL.md +395 -0
- package/skills/goal-driven-development/SKILL.md +132 -0
- package/skills/intent-grill/SKILL.md +46 -0
- package/skills/iteration-manager/SKILL.md +53 -0
- package/skills/loop-engineer/SKILL.md +108 -0
- package/skills/nodejs-npm-auto-release/SKILL.md +141 -0
- package/skills/prd/SKILL.md +63 -0
- package/skills/project-health-audit/SKILL.md +64 -0
- package/skills/ralph/SKILL.md +329 -0
- package/skills/ralph-yolo/SKILL.md +623 -0
- package/skills/security-audit/SKILL.md +114 -0
- package/skills/security-audit/references/audit-checklist.md +135 -0
- package/skills/security-audit/references/evidence-conventions.md +54 -0
- package/skills/security-audit/references/findings-schema.md +37 -0
- package/skills/security-audit/references/stack-signatures.md +66 -0
- package/skills/shipgate/SKILL.md +40 -0
- package/skills/shipgate-install/SKILL.md +87 -0
- package/skills/shipgate-quality/SKILL.md +80 -0
- package/skills/shipgate-security/SKILL.md +97 -0
- package/skills/shipgate-spec/SKILL.md +67 -0
- package/skills/ux-experience-audit/SKILL.md +202 -0
- package/src/cli.mjs +118 -0
- package/src/commands/ask.mjs +82 -0
- package/src/commands/deploy.mjs +587 -0
- package/src/commands/gates.mjs +83 -0
- package/src/commands/policy.mjs +116 -0
- package/src/gates/quality.mjs +123 -0
- package/src/gates/security.mjs +92 -0
- package/src/gates/ship.mjs +74 -0
- package/src/gates/spec.mjs +88 -0
- package/src/harness/index.mjs +203 -0
- package/src/inject/render.mjs +75 -0
- package/src/lib/cfg.mjs +66 -0
- package/src/lib/duration.mjs +41 -0
- package/src/lib/engines.mjs +182 -0
- package/src/lib/exec.mjs +80 -0
- package/src/lib/fsx.mjs +119 -0
- package/src/lib/gate.mjs +329 -0
- package/src/lib/log.mjs +31 -0
- package/src/lib/skills.mjs +347 -0
- package/src/lib/state.mjs +50 -0
- package/src/lib/update.mjs +67 -0
- package/src/version.mjs +14 -0
- package/templates/agents-snippet.md +82 -0
- package/templates/dev-profile.schema.json +119 -0
- package/templates/prd.json.example +64 -0
- package/templates/rule.json.example +28 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "graph-first-gate",
|
|
3
|
+
"version": 7,
|
|
4
|
+
"description": "DeepSeek Harness flavour of the same hard gate the pi adapter enforces. v6 (2026-11-15) closes the parity gap that v5 wrote into this file as a permanent limitation: the installed dsh DOES expose `tools/result` (synchronous frozen outcome), `agent/turn-stopping` (serial turn boundary that may steer another step), `agent/pre-step` (waterfall that sees the claimed user messages) and `{kind:'ask'}` from `tools/pre-execute` backed by `ctx.approval`. So the checks v5 turned off are back: graph evidence is judged on the RESULT (an empty `{\"total\":0}` no longer buys a read window), read evidence is recorded only on success, blind retry and the CHG-contract rule work, and the turn-level no-slack rule is active through `agent/turn-stopping` + `agent.steer()`. Domain classification now runs once per turn on the real user prompt instead of lazily on the first tool event with an empty prompt. The three-tier destructive policy can ask: the adapter returns `ask` only when `ctx.approval.effectivePolicy(session)` is `ask`, and otherwise proceeds and says so on stderr — a headless run must not be bricked by a question nothing can answer. v4 engine fixes are inherited unchanged (30-minute 200-block window, PowerShell/MCP-aware helpers, bare email is not a credential). v7 (2026-11-16) carries the same CHG-contract strengthening as pi v6: 'opened one contract file' becomes 'a standing contract' — the tasks/CHG-<id>/ directory must contain SPEC.md + PRD.md + TRACEABILITY.md, the SPEC must name an acceptance condition, an explicitly declared draft status is refused, and the contract must belong to the repository being edited.",
|
|
5
|
+
"reminder": "[system-reminder · 三层代码阅读 + 动脑子 + 不偷懒 · 每轮生效]\nLayer 0 动脑子:改代码前先回答五问——项目约定?环境现状?字面背后的真实需求?任务目的?产出价值?没读过目标文件、没判根因,不要动手。\nLayer 1 图谱:read 代码文件前先用 codebase-memory MCP(search_graph / trace_path / get_code_snippet / query_graph / get_architecture / search_code)查结构与调用关系。空结果不算合规:先查 index_status / 重新索引,回图谱重查。\nLayer 2 索引:项目未索引或索引过期(代码比索引新)时,先 index_repository / detect_changes,完成后回到 Layer 1——不允许索引完直接 read。\nLayer 3 直读:仅当重索引后图谱仍无法满足(非代码文件、图谱查不到、本会话自己改动的文件)才直读。\n闸门强度:有内容的图谱查询给 10 分钟窗口;查询点名的文件/包另给 30 分钟作用域解锁。bash 的 cat / grep -r / git show / find -exec / sed -i / 重定向写文件同样受管;PowerShell 的 Get-Content / Set-Content / Remove-Item 同样受管。\n改已存在文件需要:本会话在有效期内读过它(默认 30 分钟),或图谱点名过它;改之前还要读项目约定(AGENTS.md / CLAUDE.md / CONTRIBUTING.md / .cursorrules,存在才要求)。\n破坏性命令分两档:删 $HOME / 删 cwd / 含 .. 的路径 / 磁盘格式化 / 裸设备写入是红线,任何授权都不放行;受保护工作区(config.protected_worktrees 登记的目录,未提交的内容就是正在运行的状态)里的 git stash / reset --hard / clean -f / checkout -- . 等清场命令同样是红线、任何模式都不放行——git status 看着「脏」不等于可以收拾,普通仓库的 git stash 不受影响;普通删除、git 历史重写、强推、DDL 等按类别授权(默认询问,主人可用 /gate grant|ask|deny 调整,agent 不能自己改授权表);被确认卡住(尤其彻夜跑)时可提示主人 /gate mode bypass 8h 临时放开破坏性命令——到期自动回 enforce,红线仍拦,其他门控不受影响;同一条失败命令原样重试第 3 次也会被拦。\n轮次级不偷懒:一轮结束时只输出「稍后再补 / 后续再做 / 先不实现」而不动工具,会被要求继续做完;确实阻塞就写清阻塞点。\n拦截上限只作用于研究规则,且按 30 分钟窗口重置;凭据写入、越界写入、破坏性命令永远生效。门控配置读不出来时降级为安全底线并显式告警。\n\n[ai-spec 门控 · 改代码前必过]\n改任何代码文件前,本会话必须读过**本项目**一份**成立**的 CHG 契约:tasks/CHG-<id>/ 下 SPEC.md + PRD.md + TRACEABILITY.md 三件齐全、SPEC 写明验收判据、status 不是 draft。只写一个 SPEC.md 不算立项;读别的仓库的 CHG 不算数。\n五问:属于哪个 CHG?四件套齐吗?目标文件在独占清单里吗?改完哪条 AC 变绿?先判根因还是打补丁?\n开发中发现的问题当场修,不许留给「后续」;收尾必须达成该 CHG 的预定功能目标,而不是「大部分做完」。",
|
|
6
|
+
"checks": [
|
|
7
|
+
"no-write-outside",
|
|
8
|
+
"no-secret-write",
|
|
9
|
+
"no-destructive-bash",
|
|
10
|
+
"no-self-grant",
|
|
11
|
+
"index-freshness-before-read",
|
|
12
|
+
"graph-before-read",
|
|
13
|
+
"bash-graph-before-read",
|
|
14
|
+
"think-before-write",
|
|
15
|
+
"chg-contract-before-edit",
|
|
16
|
+
"no-blind-retry"
|
|
17
|
+
],
|
|
18
|
+
"default_profile": "general-dev",
|
|
19
|
+
"profiles": ["ai4s-dry-lab", "ai4s-quant"],
|
|
20
|
+
"classifier": {
|
|
21
|
+
"enabled": true,
|
|
22
|
+
"model_judge": false,
|
|
23
|
+
"timeout_ms": 8000,
|
|
24
|
+
"external_judge": {
|
|
25
|
+
"enabled": false,
|
|
26
|
+
"note": "kept as a field only; calling an external judge is out of scope for v6"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"config": {
|
|
30
|
+
"project_roots": [],
|
|
31
|
+
"exclude_globs": [
|
|
32
|
+
"**/node_modules/**",
|
|
33
|
+
"**/vendor/**",
|
|
34
|
+
"**/dist/**",
|
|
35
|
+
"**/build/**",
|
|
36
|
+
"**/.git/**",
|
|
37
|
+
"**/site-packages/**",
|
|
38
|
+
"**/.venv/**",
|
|
39
|
+
"**/target/**"
|
|
40
|
+
],
|
|
41
|
+
"max_blocks_per_session": 200,
|
|
42
|
+
"block_cap_reset_ms": 1800000,
|
|
43
|
+
"signal_ttl_ms": 600000,
|
|
44
|
+
"unlock_ttl_ms": 1800000,
|
|
45
|
+
"inspected_ttl_ms": 1800000,
|
|
46
|
+
"bash_read_check": true,
|
|
47
|
+
"index_marker": ".codebase-memory",
|
|
48
|
+
"index_mtime_epsilon_ms": 2000,
|
|
49
|
+
"index_mtime_ttl_ms": 30000,
|
|
50
|
+
"graph_signal_requires_content": true,
|
|
51
|
+
"graph_signal_min_chars": 40,
|
|
52
|
+
"require_target_evidence": true,
|
|
53
|
+
"require_conventions": true,
|
|
54
|
+
"convention_files": ["AGENTS.md", "CLAUDE.md", "CONTRIBUTING.md", ".cursorrules"],
|
|
55
|
+
"require_chg_contract": true,
|
|
56
|
+
"chg_contract_globs": [
|
|
57
|
+
"**/tasks/CHG-*/SPEC.md",
|
|
58
|
+
"**/tasks/CHG-*/PRD.md",
|
|
59
|
+
"**/tasks/CHG-*/CHANGE.md",
|
|
60
|
+
"**/tasks/CHG-*/TRACEABILITY.md"
|
|
61
|
+
],
|
|
62
|
+
"chg_contract_scope_globs": [],
|
|
63
|
+
"chg_contract_required_files": ["SPEC.md", "PRD.md", "TRACEABILITY.md"],
|
|
64
|
+
"chg_acceptance_markers": ["验收", "AC-", "断言", "可判定", "Acceptance"],
|
|
65
|
+
"chg_status_allow": ["approved", "executing", "active", "in-progress", "in_progress"],
|
|
66
|
+
"chg_status_fields": ["status", "state"],
|
|
67
|
+
"max_identical_failures": 2,
|
|
68
|
+
"retry_window_ms": 600000,
|
|
69
|
+
"slack_check": true,
|
|
70
|
+
"slack_max_continues": 2,
|
|
71
|
+
"slack_patterns": [],
|
|
72
|
+
"destructive_allow_patterns": [],
|
|
73
|
+
"destructive_confirm_mode": true,
|
|
74
|
+
"destructive_grants": {
|
|
75
|
+
"delete": "confirm",
|
|
76
|
+
"git-history": "confirm",
|
|
77
|
+
"git-force-push": "confirm",
|
|
78
|
+
"db-ddl": "deny",
|
|
79
|
+
"perm-recursive": "confirm",
|
|
80
|
+
"process-kill": "confirm",
|
|
81
|
+
"raw-write": "confirm"
|
|
82
|
+
},
|
|
83
|
+
"destructive_mode": "enforce",
|
|
84
|
+
"destructive_mode_until": 0,
|
|
85
|
+
"protected_worktrees": [],
|
|
86
|
+
"profiles_dir": "profiles",
|
|
87
|
+
"worklog_path": "docs/WORKLOG.md",
|
|
88
|
+
"worklog_ttl_ms": 1800000,
|
|
89
|
+
"result_dirs": [],
|
|
90
|
+
"readme_prefix": "README_",
|
|
91
|
+
"script_log_check": true
|
|
92
|
+
}
|
|
93
|
+
}
|