holo-codex 0.1.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 (149) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/CONTRIBUTING.md +54 -0
  3. package/LICENSE +21 -0
  4. package/README.md +215 -0
  5. package/README.zh-CN.md +215 -0
  6. package/SECURITY.md +39 -0
  7. package/assets/brand/README.md +35 -0
  8. package/assets/brand/holo-codex-icon.svg +28 -0
  9. package/assets/brand/holo-codex-lockup.svg +49 -0
  10. package/assets/brand/holo-codex-mark.svg +33 -0
  11. package/assets/brand/holo-codex-plugin-card.png +0 -0
  12. package/assets/brand/holo-codex-plugin-card.svg +81 -0
  13. package/assets/brand/holo-codex-readme-hero.png +0 -0
  14. package/assets/brand/holo-codex-readme-hero.svg +140 -0
  15. package/assets/brand/holo-codex-social-preview.png +0 -0
  16. package/assets/brand/holo-codex-social-preview.svg +130 -0
  17. package/assets/brand/holo-codex-wordmark-options.svg +52 -0
  18. package/docs/checklists/agent-loop-first-delivery-audit.md +129 -0
  19. package/docs/examples/generic-loop-repo-hygiene.md +168 -0
  20. package/docs/install.md +190 -0
  21. package/docs/local-release-readiness.md +206 -0
  22. package/docs/release-checklist.md +144 -0
  23. package/docs/self-bootstrap.md +150 -0
  24. package/docs/trust-and-safety.md +45 -0
  25. package/package.json +83 -0
  26. package/plugins/autonomous-pr-loop/.codex-plugin/plugin.json +17 -0
  27. package/plugins/autonomous-pr-loop/.mcp.json +13 -0
  28. package/plugins/autonomous-pr-loop/bin/agent-loop.mjs +31 -0
  29. package/plugins/autonomous-pr-loop/core/artifacts.ts +164 -0
  30. package/plugins/autonomous-pr-loop/core/autonomy-policy.ts +206 -0
  31. package/plugins/autonomous-pr-loop/core/ci.ts +131 -0
  32. package/plugins/autonomous-pr-loop/core/cli-i18n.ts +123 -0
  33. package/plugins/autonomous-pr-loop/core/cli.ts +1413 -0
  34. package/plugins/autonomous-pr-loop/core/command-runner.ts +446 -0
  35. package/plugins/autonomous-pr-loop/core/command.ts +47 -0
  36. package/plugins/autonomous-pr-loop/core/config-editor.ts +140 -0
  37. package/plugins/autonomous-pr-loop/core/config.ts +293 -0
  38. package/plugins/autonomous-pr-loop/core/controller-host.ts +19 -0
  39. package/plugins/autonomous-pr-loop/core/dashboard-server.ts +536 -0
  40. package/plugins/autonomous-pr-loop/core/delivery-work-item.ts +217 -0
  41. package/plugins/autonomous-pr-loop/core/doctor.ts +335 -0
  42. package/plugins/autonomous-pr-loop/core/errors.ts +82 -0
  43. package/plugins/autonomous-pr-loop/core/gate-recovery.ts +176 -0
  44. package/plugins/autonomous-pr-loop/core/gates.ts +26 -0
  45. package/plugins/autonomous-pr-loop/core/generic-lifecycle.ts +399 -0
  46. package/plugins/autonomous-pr-loop/core/git.ts +213 -0
  47. package/plugins/autonomous-pr-loop/core/github.ts +269 -0
  48. package/plugins/autonomous-pr-loop/core/gitnexus.ts +90 -0
  49. package/plugins/autonomous-pr-loop/core/happy.ts +42 -0
  50. package/plugins/autonomous-pr-loop/core/hook-capture.ts +115 -0
  51. package/plugins/autonomous-pr-loop/core/hook-events.ts +22 -0
  52. package/plugins/autonomous-pr-loop/core/hook-installation.ts +85 -0
  53. package/plugins/autonomous-pr-loop/core/hook-observer.ts +84 -0
  54. package/plugins/autonomous-pr-loop/core/hook-policy.ts +423 -0
  55. package/plugins/autonomous-pr-loop/core/hook-router.ts +452 -0
  56. package/plugins/autonomous-pr-loop/core/index.ts +32 -0
  57. package/plugins/autonomous-pr-loop/core/local-install.ts +778 -0
  58. package/plugins/autonomous-pr-loop/core/locale.ts +60 -0
  59. package/plugins/autonomous-pr-loop/core/loop-shapes.ts +190 -0
  60. package/plugins/autonomous-pr-loop/core/mcp-controller.ts +1479 -0
  61. package/plugins/autonomous-pr-loop/core/notification-feed.ts +263 -0
  62. package/plugins/autonomous-pr-loop/core/plan-parser.ts +206 -0
  63. package/plugins/autonomous-pr-loop/core/plugin-paths.ts +32 -0
  64. package/plugins/autonomous-pr-loop/core/policy.ts +65 -0
  65. package/plugins/autonomous-pr-loop/core/pr-lifecycle.ts +464 -0
  66. package/plugins/autonomous-pr-loop/core/pr-selector.ts +284 -0
  67. package/plugins/autonomous-pr-loop/core/profiles.ts +439 -0
  68. package/plugins/autonomous-pr-loop/core/redaction.ts +17 -0
  69. package/plugins/autonomous-pr-loop/core/repo-root.ts +22 -0
  70. package/plugins/autonomous-pr-loop/core/review-comments.ts +77 -0
  71. package/plugins/autonomous-pr-loop/core/scope-guard.ts +179 -0
  72. package/plugins/autonomous-pr-loop/core/state-machine.ts +828 -0
  73. package/plugins/autonomous-pr-loop/core/state-types.ts +130 -0
  74. package/plugins/autonomous-pr-loop/core/storage.ts +2527 -0
  75. package/plugins/autonomous-pr-loop/core/types.ts +567 -0
  76. package/plugins/autonomous-pr-loop/core/worker-events.ts +412 -0
  77. package/plugins/autonomous-pr-loop/core/worker-policy.ts +72 -0
  78. package/plugins/autonomous-pr-loop/core/worker-prompts.ts +182 -0
  79. package/plugins/autonomous-pr-loop/core/worker.ts +809 -0
  80. package/plugins/autonomous-pr-loop/core/workflow-board.ts +1515 -0
  81. package/plugins/autonomous-pr-loop/hooks/dist/permission-request.js +2462 -0
  82. package/plugins/autonomous-pr-loop/hooks/dist/post-compact.js +2462 -0
  83. package/plugins/autonomous-pr-loop/hooks/dist/post-tool-use.js +2462 -0
  84. package/plugins/autonomous-pr-loop/hooks/dist/pre-compact.js +2462 -0
  85. package/plugins/autonomous-pr-loop/hooks/dist/pre-tool-use.js +3460 -0
  86. package/plugins/autonomous-pr-loop/hooks/dist/session-start.js +2462 -0
  87. package/plugins/autonomous-pr-loop/hooks/dist/stop.js +2462 -0
  88. package/plugins/autonomous-pr-loop/hooks/dist/user-prompt-submit.js +2462 -0
  89. package/plugins/autonomous-pr-loop/hooks/hooks.json +106 -0
  90. package/plugins/autonomous-pr-loop/hooks/observe-runner.ts +25 -0
  91. package/plugins/autonomous-pr-loop/hooks/permission-request.ts +4 -0
  92. package/plugins/autonomous-pr-loop/hooks/post-compact.ts +4 -0
  93. package/plugins/autonomous-pr-loop/hooks/post-tool-use.ts +4 -0
  94. package/plugins/autonomous-pr-loop/hooks/pre-compact.ts +4 -0
  95. package/plugins/autonomous-pr-loop/hooks/pre-tool-use.ts +44 -0
  96. package/plugins/autonomous-pr-loop/hooks/session-start.ts +4 -0
  97. package/plugins/autonomous-pr-loop/hooks/stop.ts +4 -0
  98. package/plugins/autonomous-pr-loop/hooks/user-prompt-submit.ts +4 -0
  99. package/plugins/autonomous-pr-loop/mcp-server/src/index.ts +87 -0
  100. package/plugins/autonomous-pr-loop/mcp-server/src/tools.ts +205 -0
  101. package/plugins/autonomous-pr-loop/package.json +9 -0
  102. package/plugins/autonomous-pr-loop/schemas/config.schema.json +74 -0
  103. package/plugins/autonomous-pr-loop/schemas/marketplace.schema.json +46 -0
  104. package/plugins/autonomous-pr-loop/schemas/plugin.schema.json +32 -0
  105. package/plugins/autonomous-pr-loop/schemas/state.schema.json +19 -0
  106. package/plugins/autonomous-pr-loop/schemas/worker-event.schema.json +19 -0
  107. package/plugins/autonomous-pr-loop/schemas/worker-result.schema.json +58 -0
  108. package/plugins/autonomous-pr-loop/scripts/agent-loop.ts +44 -0
  109. package/plugins/autonomous-pr-loop/skills/autonomous-pr-loop/SKILL.md +26 -0
  110. package/plugins/autonomous-pr-loop/skills/autonomous-pr-loop/agents/openai.yaml +6 -0
  111. package/plugins/autonomous-pr-loop/ui/index.html +26 -0
  112. package/plugins/autonomous-pr-loop/ui/public/favicon.svg +7 -0
  113. package/plugins/autonomous-pr-loop/ui/src/api.ts +639 -0
  114. package/plugins/autonomous-pr-loop/ui/src/app.tsx +238 -0
  115. package/plugins/autonomous-pr-loop/ui/src/components/ActivityBadge.tsx +31 -0
  116. package/plugins/autonomous-pr-loop/ui/src/components/BrandMark.tsx +36 -0
  117. package/plugins/autonomous-pr-loop/ui/src/components/Collapsible.tsx +6 -0
  118. package/plugins/autonomous-pr-loop/ui/src/components/CommandPreview.tsx +15 -0
  119. package/plugins/autonomous-pr-loop/ui/src/components/ConfigEditor.tsx +389 -0
  120. package/plugins/autonomous-pr-loop/ui/src/components/EmptyState.tsx +10 -0
  121. package/plugins/autonomous-pr-loop/ui/src/components/ErrorState.tsx +12 -0
  122. package/plugins/autonomous-pr-loop/ui/src/components/List.tsx +7 -0
  123. package/plugins/autonomous-pr-loop/ui/src/components/MetricRow.tsx +6 -0
  124. package/plugins/autonomous-pr-loop/ui/src/components/ResponsiveTable.tsx +65 -0
  125. package/plugins/autonomous-pr-loop/ui/src/components/RiskBadge.tsx +10 -0
  126. package/plugins/autonomous-pr-loop/ui/src/components/StatusBadge.tsx +29 -0
  127. package/plugins/autonomous-pr-loop/ui/src/components/TopMetric.tsx +10 -0
  128. package/plugins/autonomous-pr-loop/ui/src/fixtures.ts +1152 -0
  129. package/plugins/autonomous-pr-loop/ui/src/i18n.ts +1105 -0
  130. package/plugins/autonomous-pr-loop/ui/src/main.tsx +14 -0
  131. package/plugins/autonomous-pr-loop/ui/src/pages/CommandCenter.tsx +470 -0
  132. package/plugins/autonomous-pr-loop/ui/src/pages/CommandCenterParts.tsx +276 -0
  133. package/plugins/autonomous-pr-loop/ui/src/pages/agent-timeline/AgentTimelineView.tsx +73 -0
  134. package/plugins/autonomous-pr-loop/ui/src/pages/artifact-viewer/ArtifactViewer.tsx +44 -0
  135. package/plugins/autonomous-pr-loop/ui/src/pages/dry-run-preview/DryRunPreview.tsx +66 -0
  136. package/plugins/autonomous-pr-loop/ui/src/pages/event-ledger/EventLedger.tsx +17 -0
  137. package/plugins/autonomous-pr-loop/ui/src/pages/gate-center/GateCenter.tsx +34 -0
  138. package/plugins/autonomous-pr-loop/ui/src/pages/mission-control/MissionControl.tsx +104 -0
  139. package/plugins/autonomous-pr-loop/ui/src/pages/mission-control/WorkflowBoard.tsx +577 -0
  140. package/plugins/autonomous-pr-loop/ui/src/pages/notifications/NotificationsView.tsx +30 -0
  141. package/plugins/autonomous-pr-loop/ui/src/pages/plan-navigator/PlanNavigator.tsx +19 -0
  142. package/plugins/autonomous-pr-loop/ui/src/pages/policy-config/PolicyConfig.tsx +22 -0
  143. package/plugins/autonomous-pr-loop/ui/src/pages/pr-inbox/PrInbox.tsx +26 -0
  144. package/plugins/autonomous-pr-loop/ui/src/pages/recovery-center/RecoveryCenter.tsx +125 -0
  145. package/plugins/autonomous-pr-loop/ui/src/pages/scope-guard/ScopeGuard.tsx +16 -0
  146. package/plugins/autonomous-pr-loop/ui/src/pages/worker-runs/WorkerRuns.tsx +39 -0
  147. package/plugins/autonomous-pr-loop/ui/src/styles.css +2673 -0
  148. package/plugins/autonomous-pr-loop/ui/src/theme.ts +57 -0
  149. package/tsconfig.json +18 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "codex-auto-pr-loop",
3
+ "interface": {
4
+ "displayName": "HOLO-Codex"
5
+ },
6
+ "plugins": [
7
+ {
8
+ "name": "autonomous-pr-loop",
9
+ "source": {
10
+ "source": "local",
11
+ "path": "./plugins/autonomous-pr-loop"
12
+ },
13
+ "policy": {
14
+ "installation": "AVAILABLE",
15
+ "authentication": "ON_INSTALL"
16
+ },
17
+ "category": "Engineering"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,54 @@
1
+ # Contributing
2
+
3
+ Thanks for helping improve HOLO-Codex.
4
+
5
+ ## Development Setup
6
+
7
+ ```bash
8
+ pnpm install
9
+ pnpm build:hooks
10
+ pnpm test
11
+ pnpm lint
12
+ ```
13
+
14
+ Use `pnpm agent-loop ...` while working inside this repository. Use the global `agent-loop ...` command only after running the local install workflow described in [Local Release Readiness](./docs/local-release-readiness.md).
15
+
16
+ ## Runtime Compatibility Names
17
+
18
+ HOLO-Codex is the public product name. The `agent-loop` CLI, `.agent-loop/` runtime directory, `autonomous-pr-loop` plugin id, and `plugins/autonomous-pr-loop/` source path are stable compatibility identifiers. Do not rename them without a migration plan.
19
+
20
+ ## PR Workflow
21
+
22
+ - Keep each PR scoped to one issue.
23
+ - Start from latest `main`.
24
+ - Do not commit `.agent-loop/`, SQLite files, tokens, raw hook payloads, raw transcripts, or worker logs.
25
+ - Run focused tests for touched areas, then `pnpm lint` and `pnpm test`.
26
+ - If GitNexus is configured, inspect impact before risky symbol edits and run detect before committing:
27
+
28
+ Use the GitNexus repo id configured on your machine:
29
+
30
+ ```bash
31
+ npx gitnexus detect-changes --repo <indexed-repo-id> --scope staged
32
+ ```
33
+
34
+ ## Maintainer Delivery Loop
35
+
36
+ For repository self-maintenance, use the local delivery workflow:
37
+
38
+ ```bash
39
+ pnpm agent-loop delivery bind --issue ISSUE --title "..." --url https://github.com/OWNER/REPO/issues/ISSUE --json
40
+ pnpm agent-loop delivery stage --stage plan --status active --summary "Planning work." --json
41
+ ```
42
+
43
+ Record meaningful stage evidence for plan, build, verify, PR, review, merge readiness, and cleanup. PR bodies and reviewer comments should include the bound run id when using the delivery loop.
44
+
45
+ ## Review Expectations
46
+
47
+ - Classify findings as P0/P1/P2/P3.
48
+ - Fix real P0/P1/P2 findings before merge unless a P2 is explicitly routed to a linked follow-up issue.
49
+ - Keep P3 polish in the same PR when it is small and in scope.
50
+ - Reviewer reports from external agents should be posted as PR comments when that workflow is used.
51
+
52
+ ## Public Source Hygiene
53
+
54
+ Historical private planning docs, local handoff notes, Logseq artifacts, and runtime files should not be included in public release artifacts. The public repository should be usable from active docs, not from private chat history.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 HOLO-Codex contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,215 @@
1
+ # HOLO-Codex
2
+
3
+ [中文文档](./README.zh-CN.md)
4
+
5
+ ![HOLO-Codex README hero](./assets/brand/holo-codex-readme-hero.png)
6
+
7
+ HOLO-Codex, short for **Human On Loop Codex**, turns long-running Codex workflows into observable, recoverable, human-on-loop systems. The operator sets goals and boundaries, observes progress, and steps in only when a real gate needs attention.
8
+
9
+ The supervisor owns durable workflow state, evidence, gates, worker orchestration, Codex hooks, the MCP control plane, and the local dashboard. Workers perform scoped tasks and return structured output.
10
+
11
+ ## What It Provides
12
+
13
+ - A Codex plugin under `plugins/autonomous-pr-loop/`.
14
+ - The `agent-loop` CLI for local loop state, hooks, dashboard, workflow evidence, and rollback-safe local install.
15
+ - Local SQLite state under `.agent-loop/`.
16
+ - A local dashboard for Mission Control, workflow board, observability, gates, review/CI state, workers, artifacts, recovery, notifications, policy config, and theme modes.
17
+ - stdio MCP control plane.
18
+ - Codex hooks for policy checks and observability.
19
+ - TypeScript + Vitest test suite.
20
+ - Bilingual display support for `zh-CN`, `en-US`, and `system` locale selection.
21
+ - Workflow profiles, role profiles, `generic-loop`, and the first bundled workflow: `pr-loop`.
22
+
23
+ This is not a hosted service. It does not run GitHub webhooks or cloud workers.
24
+
25
+ ## Compatibility Names
26
+
27
+ HOLO-Codex is the public product name. Some stable runtime identifiers intentionally keep their legacy names for compatibility:
28
+
29
+ - CLI command: `agent-loop`
30
+ - Runtime state directory: `.agent-loop/`
31
+ - Plugin id and MCP server id: `autonomous-pr-loop`
32
+ - Source directory: `plugins/autonomous-pr-loop/`
33
+ - npm package name: `holo-codex`
34
+ - Local marketplace entry name: `codex-auto-pr-loop`
35
+
36
+ Do not treat those names as a second product. They are compatibility identifiers.
37
+
38
+ ## First Workflow: PR Delivery
39
+
40
+ PR delivery is the first complete workflow shipped with HOLO-Codex. It is the strongest sample of the loop model, not the product boundary.
41
+
42
+ Typical flow:
43
+
44
+ ```text
45
+ sync main
46
+ bind work item
47
+ plan
48
+ build
49
+ verify
50
+ open PR
51
+ run review / CI
52
+ fix findings
53
+ check merge readiness
54
+ merge
55
+ cleanup
56
+ ```
57
+
58
+ The dashboard and MCP tools read persisted loop state. They do not rely on chat history.
59
+
60
+ The same control-plane model can support other long-running Codex workflows such as release preparation, repo hygiene, security review, docs publishing, migrations, evaluations, and customer-issue triage.
61
+
62
+ ## Install
63
+
64
+ Canonical public source:
65
+
66
+ ```text
67
+ https://github.com/tizerluo/HOLO-Codex
68
+ ```
69
+
70
+ Requirements:
71
+
72
+ - Node.js `>=22.5`
73
+ - `git`
74
+ - GitHub CLI `gh`
75
+ - Codex CLI / plugin support
76
+ - `pnpm` when installing from source or using rollback-snapshot local install
77
+ - Optional but recommended: GitNexus via `npx gitnexus`
78
+
79
+ Install from npm:
80
+
81
+ ```bash
82
+ npm install --global holo-codex
83
+ # Replace /path/to/repo with the repository you want HOLO-Codex to supervise.
84
+ agent-loop --repo /path/to/repo init
85
+ agent-loop install-hooks --repo /path/to/repo
86
+ agent-loop --repo /path/to/repo doctor
87
+ ```
88
+
89
+ The npm package installs the `agent-loop` CLI. `agent-loop install-hooks` installs or refreshes the hook router and target binding without reinstalling the global CLI. To remove an npm install, run `agent-loop hooks unbind --repo /path/to/repo`, remove HOLO-Codex router entries from `~/.codex/hooks.json` only when no target repositories still use them, and then run `npm uninstall --global holo-codex`.
90
+
91
+ Install from source when developing HOLO-Codex or when you want to inspect the source checkout directly:
92
+
93
+ ```bash
94
+ git clone https://github.com/tizerluo/HOLO-Codex.git
95
+ cd HOLO-Codex
96
+ pnpm install
97
+ pnpm build:hooks
98
+ # Replace /path/to/repo with the repository you want HOLO-Codex to supervise.
99
+ pnpm agent-loop local install --repo /path/to/repo
100
+ agent-loop --repo /path/to/repo status
101
+ ```
102
+
103
+ `pnpm agent-loop ...` is the source checkout command. `agent-loop ...` is the global convenience command for day-to-day use from any directory after npm or local source install. Use `agent-loop local snapshots prune --keep 10` to preview old snapshot cleanup, and add `--apply` only when you want to delete valid old snapshots.
104
+
105
+ For a complete local install, upgrade, reinstall, uninstall, and smoke-test checklist, see [Local Release Readiness](./docs/local-release-readiness.md).
106
+
107
+ Add HOLO-Codex to the local Codex plugin marketplace. For npm installs:
108
+
109
+ ```bash
110
+ codex plugin marketplace add "$(npm root -g)/holo-codex"
111
+ ```
112
+
113
+ For source installs:
114
+
115
+ ```bash
116
+ codex plugin marketplace add /path/to/HOLO-Codex
117
+ ```
118
+
119
+ Then enable the `autonomous-pr-loop` plugin in Codex. Plugin enablement and global CLI installation are separate steps.
120
+
121
+ ## Initialize State
122
+
123
+ Run from the target repository root:
124
+
125
+ ```bash
126
+ agent-loop --repo /path/to/repo init
127
+ agent-loop --repo /path/to/repo doctor
128
+ agent-loop --repo /path/to/repo status
129
+ ```
130
+
131
+ Install Codex hooks:
132
+
133
+ ```bash
134
+ agent-loop install-hooks --repo /path/to/repo
135
+ ```
136
+
137
+ This installs one stable hook router into `~/.codex/hooks.json`, preserves existing user hooks, and records the target repository binding under `~/.codex/agent-loop/hook-bindings.json`.
138
+
139
+ Multi-repo note: multiple repositories can share the same `CODEX_HOME`; hook events are routed by Codex cwd/worktree/session context before any repo state is written or policy is applied. A separate `CODEX_HOME` remains useful for high-isolation sandbox testing.
140
+
141
+ Runtime files are written to `.agent-loop/` and must not be committed.
142
+
143
+ ## Dashboard
144
+
145
+ ```bash
146
+ agent-loop --repo /path/to/repo dashboard
147
+ ```
148
+
149
+ The command prints a loopback URL on stdout and a fallback session token on stderr:
150
+
151
+ ```text
152
+ dashboard started
153
+ url: http://127.0.0.1:<port>/
154
+ targetRepoRoot: /path/to/repo
155
+ ```
156
+
157
+ Dashboard mutations require the local session token and go through the shared controller. The UI does not write SQLite directly. Loopback dashboard sessions unlock through a same-origin session bootstrap; the stderr token is only a fallback for static UI or recovery. Do not copy it into docs, logs, PR bodies, commits, artifacts, or screenshots.
158
+
159
+ Dashboard-visible delivery work is produced by persisted `agent-loop` actions and workflow evidence. Direct terminal edits or commander decisions are not automatically visible unless they are recorded through agent-loop events, artifacts, or PR comments. For the current self-maintenance flow, see [Self-bootstrap workflow](./docs/self-bootstrap.md). For an end-to-end audit template, see [Agent-loop-first Delivery Audit Checklist](./docs/checklists/agent-loop-first-delivery-audit.md).
160
+
161
+ ## Common CLI
162
+
163
+ ```bash
164
+ agent-loop --repo /path/to/repo status
165
+ agent-loop --repo /path/to/repo init --dry-run
166
+ agent-loop --repo /path/to/repo doctor
167
+ agent-loop --repo /path/to/repo run --dry-run
168
+ agent-loop --repo /path/to/repo run --until=gate
169
+ agent-loop --repo /path/to/repo step
170
+ agent-loop --repo /path/to/repo resume
171
+ agent-loop --repo /path/to/repo stop
172
+ agent-loop --repo /path/to/repo timeline --limit 20
173
+ agent-loop --repo /path/to/repo workers --events
174
+ agent-loop --repo /path/to/repo observe
175
+ agent-loop --repo /path/to/repo audit-export --run RUN_ID --format markdown
176
+ agent-loop --repo /path/to/repo recover
177
+ agent-loop --repo /path/to/repo approve-gate <gate-id> --note "reason"
178
+ agent-loop --repo /path/to/repo dashboard
179
+ ```
180
+
181
+ Human-readable CLI output supports `--locale zh-CN|en-US|system`. JSON output remains structured and stable.
182
+
183
+ ## Workflow Profiles And Themes
184
+
185
+ The default workflow remains `pr-loop` with `default_pr_loop` and `default_pr_roles`. Policy Config can also select `generic-loop` with built-in profiles for research reports, document preparation, repo hygiene, weekly review, and data extraction workflows. For a concrete non-PR workflow, see the [generic-loop repo hygiene example](./docs/examples/generic-loop-repo-hygiene.md).
186
+
187
+ Dashboard theme is a local browser preference. It supports `light`, `dark`, and `system`, and does not write to repo config or SQLite.
188
+
189
+ ## Safety Boundaries
190
+
191
+ - Workers may edit files but cannot commit, push, create PRs, mark PRs ready, or merge.
192
+ - The supervisor owns Git and GitHub lifecycle actions.
193
+ - Destructive Git/GitHub commands are blocked by command policy and hooks.
194
+ - Merge readiness depends on config, review/CI evidence, open review comments, scope guard, and policy decisions.
195
+ - Never store secrets in code, docs, logs, artifacts, commits, or PR bodies.
196
+ - Hooks cover the Codex tool loop, not manual commands run in an external terminal.
197
+
198
+ ## Development
199
+
200
+ ```bash
201
+ pnpm test
202
+ pnpm lint
203
+ ```
204
+
205
+ More docs:
206
+
207
+ - [Install](./docs/install.md)
208
+ - [Local Release Readiness](./docs/local-release-readiness.md)
209
+ - [Source Release Checklist](./docs/release-checklist.md)
210
+ - [Self-bootstrap workflow](./docs/self-bootstrap.md)
211
+ - [Agent-loop-first Delivery Audit Checklist](./docs/checklists/agent-loop-first-delivery-audit.md)
212
+ - [Generic-loop repo hygiene example](./docs/examples/generic-loop-repo-hygiene.md)
213
+ - [Trust and Safety](./docs/trust-and-safety.md)
214
+ - [Contributing](./CONTRIBUTING.md)
215
+ - [Security](./SECURITY.md)
@@ -0,0 +1,215 @@
1
+ # HOLO-Codex
2
+
3
+ [English README](./README.md)
4
+
5
+ ![HOLO-Codex README hero](./assets/brand/holo-codex-readme-hero.png)
6
+
7
+ HOLO-Codex 是 **Human On Loop Codex** 的缩写,它把长流程 Codex workflow 变成可观察、可恢复、可人工接管的 loop。人设定目标和边界、观察进展,并只在真实 gate 需要关注时回到环上。
8
+
9
+ Supervisor 负责持久化 workflow 状态、evidence、gates、worker 编排、Codex hooks、MCP control plane 和本地 dashboard。Worker 只做受控任务并返回结构化输出。
10
+
11
+ ## 提供能力
12
+
13
+ - `plugins/autonomous-pr-loop/` 下的 Codex 插件。
14
+ - `agent-loop` CLI:管理本地 loop 状态、hooks、dashboard、workflow evidence 和可回滚本地安装。
15
+ - `.agent-loop/` 下的本地 SQLite 状态。
16
+ - 本地 dashboard:Mission Control、workflow board、Observability Console、Gate、Review/CI、Worker、Artifact、Notifications、Recovery、Policy Config、主题模式。
17
+ - stdio MCP control plane。
18
+ - 用于 policy 检查和 observability 的 Codex hooks。
19
+ - TypeScript + Vitest 测试套件。
20
+ - `zh-CN`、`en-US`、`system` 双语显示支持。
21
+ - workflow profile、role profile、`generic-loop`,以及第一个内置 workflow:`pr-loop`。
22
+
23
+ 这不是托管服务,不提供 GitHub webhook daemon 或云端 worker。
24
+
25
+ ## 兼容名称
26
+
27
+ HOLO-Codex 是公开产品名。一些稳定运行时标识会继续保留旧名称,以避免破坏已有安装和本地状态:
28
+
29
+ - CLI 命令:`agent-loop`
30
+ - 运行态目录:`.agent-loop/`
31
+ - Plugin id 和 MCP server id:`autonomous-pr-loop`
32
+ - 源码目录:`plugins/autonomous-pr-loop/`
33
+ - npm package 名:`holo-codex`
34
+ - 本地 marketplace 条目名:`codex-auto-pr-loop`
35
+
36
+ 这些是兼容标识,不是第二个产品名。
37
+
38
+ ## 第一个工作流:PR 交付
39
+
40
+ PR 交付是 HOLO-Codex 随附的第一个完整 workflow,也是 loop 模型最强的样板,但不是产品边界。
41
+
42
+ 典型流程:
43
+
44
+ ```text
45
+ sync main
46
+ bind work item
47
+ plan
48
+ build
49
+ verify
50
+ open PR
51
+ run review / CI
52
+ fix findings
53
+ check merge readiness
54
+ merge
55
+ cleanup
56
+ ```
57
+
58
+ Dashboard 和 MCP tools 读取持久化 loop 状态,不依赖聊天历史。
59
+
60
+ 同一套 control plane 也可以承载其他长流程 Codex workflow,例如 release 准备、仓库卫生审计、安全审查、文档发布、迁移、评测和客户 issue 分诊。
61
+
62
+ ## 安装
63
+
64
+ 公开源码入口:
65
+
66
+ ```text
67
+ https://github.com/tizerluo/HOLO-Codex
68
+ ```
69
+
70
+ 依赖:
71
+
72
+ - Node.js `>=22.5`
73
+ - `git`
74
+ - GitHub CLI `gh`
75
+ - Codex CLI / plugin support
76
+ - 从源码安装或使用 snapshot/rollback local install 时需要 `pnpm`
77
+ - 可选但推荐:GitNexus,使用 `npx gitnexus`
78
+
79
+ 从 npm 安装:
80
+
81
+ ```bash
82
+ npm install --global holo-codex
83
+ # 将 /path/to/repo 替换成你要让 HOLO-Codex 监督的目标仓库。
84
+ agent-loop --repo /path/to/repo init
85
+ agent-loop install-hooks --repo /path/to/repo
86
+ agent-loop --repo /path/to/repo doctor
87
+ ```
88
+
89
+ npm package 会安装 `agent-loop` CLI。`agent-loop install-hooks` 会安装或刷新 hook router 和目标仓库绑定,不会重新安装全局 CLI。移除 npm 安装时,先运行 `agent-loop hooks unbind --repo /path/to/repo`;确认没有任何目标仓库还在使用 HOLO-Codex router 后,再从 `~/.codex/hooks.json` 手动移除 HOLO-Codex router entries,最后运行 `npm uninstall --global holo-codex`。
90
+
91
+ 开发 HOLO-Codex 或需要直接检查源码 checkout 时,从源码安装:
92
+
93
+ ```bash
94
+ git clone https://github.com/tizerluo/HOLO-Codex.git
95
+ cd HOLO-Codex
96
+ pnpm install
97
+ pnpm build:hooks
98
+ # 将 /path/to/repo 替换成你要让 HOLO-Codex 监督的目标仓库。
99
+ pnpm agent-loop local install --repo /path/to/repo
100
+ agent-loop --repo /path/to/repo status
101
+ ```
102
+
103
+ `pnpm agent-loop ...` 是源码 checkout 内的命令。`agent-loop ...` 是 npm 或本地源码安装后从任意目录日常使用的全局命令。用 `agent-loop local snapshots prune --keep 10` 预览旧 snapshot 清理;确认要删除时再加 `--apply`。
104
+
105
+ 完整的本地安装、升级、重装、卸载和 smoke test 清单见:[Local Release Readiness](./docs/local-release-readiness.md)。
106
+
107
+ 把 HOLO-Codex 加入本地 Codex plugin marketplace。npm 安装时:
108
+
109
+ ```bash
110
+ codex plugin marketplace add "$(npm root -g)/holo-codex"
111
+ ```
112
+
113
+ 源码安装时:
114
+
115
+ ```bash
116
+ codex plugin marketplace add /path/to/HOLO-Codex
117
+ ```
118
+
119
+ 然后在 Codex 中启用 `autonomous-pr-loop` 插件。Codex plugin 启用和全局 CLI 安装是两件事。
120
+
121
+ ## 初始化状态
122
+
123
+ 在目标仓库根目录执行:
124
+
125
+ ```bash
126
+ agent-loop --repo /path/to/repo init
127
+ agent-loop --repo /path/to/repo doctor
128
+ agent-loop --repo /path/to/repo status
129
+ ```
130
+
131
+ 安装 Codex hooks:
132
+
133
+ ```bash
134
+ agent-loop install-hooks --repo /path/to/repo
135
+ ```
136
+
137
+ 这会向 `~/.codex/hooks.json` 安装一组稳定 hook router,保留已有用户 hooks,并在 `~/.codex/agent-loop/hook-bindings.json` 记录目标仓库绑定。
138
+
139
+ 多仓库注意:多个仓库可以共用同一个 `CODEX_HOME`;hook event 会先按 Codex cwd/worktree/session context 路由,再写入仓库状态或执行 policy。独立 `CODEX_HOME` 仍适合高隔离 sandbox 测试。
140
+
141
+ 运行态文件写入 `.agent-loop/`,不要提交。
142
+
143
+ ## Dashboard
144
+
145
+ ```bash
146
+ agent-loop --repo /path/to/repo dashboard
147
+ ```
148
+
149
+ 命令会在 stdout 打印 loopback URL,并在 stderr 单独打印 fallback session token:
150
+
151
+ ```text
152
+ dashboard 已启动
153
+ url: http://127.0.0.1:<port>/
154
+ targetRepoRoot: /path/to/repo
155
+ ```
156
+
157
+ Dashboard mutation 必须带本地 session token,并统一走 controller。UI 不直接写 SQLite。本地 loopback dashboard 会用同源 session bootstrap 自动解锁。stderr token 只作为静态 UI 或恢复场景的 fallback;不要把它复制到 docs、日志、PR body、commit、artifact 或截图里。
158
+
159
+ Dashboard 能看到的交付工作来自持久化的 `agent-loop` 动作和 workflow evidence。直接在终端改文件或 commander 决策不会自动出现在 dashboard,除非它们被记录成 agent-loop event、artifact 或 PR comment。当前自维护流程见:[自举维护流程](./docs/self-bootstrap.md)。端到端审计模板见:[Agent-loop-first Delivery Audit Checklist](./docs/checklists/agent-loop-first-delivery-audit.md)。
160
+
161
+ ## 常用 CLI
162
+
163
+ ```bash
164
+ agent-loop --repo /path/to/repo status
165
+ agent-loop --repo /path/to/repo init --dry-run
166
+ agent-loop --repo /path/to/repo doctor
167
+ agent-loop --repo /path/to/repo run --dry-run
168
+ agent-loop --repo /path/to/repo run --until=gate
169
+ agent-loop --repo /path/to/repo step
170
+ agent-loop --repo /path/to/repo resume
171
+ agent-loop --repo /path/to/repo stop
172
+ agent-loop --repo /path/to/repo timeline --limit 20
173
+ agent-loop --repo /path/to/repo workers --events
174
+ agent-loop --repo /path/to/repo observe
175
+ agent-loop --repo /path/to/repo audit-export --run RUN_ID --format markdown
176
+ agent-loop --repo /path/to/repo recover
177
+ agent-loop --repo /path/to/repo approve-gate <gate-id> --note "reason"
178
+ agent-loop --repo /path/to/repo dashboard
179
+ ```
180
+
181
+ 人类可读 CLI 输出支持 `--locale zh-CN|en-US|system`。JSON 输出保持结构化和稳定。
182
+
183
+ ## Workflow Profiles 和主题
184
+
185
+ 默认 workflow 仍是 `pr-loop`,使用 `default_pr_loop` 和 `default_pr_roles`。Policy Config 也可以选择 `generic-loop`,并使用内置的调研报告、文档准备、仓库卫生审计、周报、数据抽取 workflow profiles。具体非 PR 工作流可参考:[generic-loop 仓库卫生审计示例](./docs/examples/generic-loop-repo-hygiene.md)。
186
+
187
+ Dashboard 主题是浏览器本地显示偏好,支持 `light`、`dark`、`system`,不会写入 repo config 或 SQLite。
188
+
189
+ ## 安全边界
190
+
191
+ - Worker 可以改文件,但不能 commit、push、create PR、mark PR ready 或 merge。
192
+ - Supervisor 负责 Git 和 GitHub 生命周期。
193
+ - 破坏性 Git/GitHub 命令由 command policy 和 hooks 阻止。
194
+ - Merge readiness 由 config、review/CI evidence、open review comments、scope guard 和 policy decisions 共同决定。
195
+ - 不要把密钥写入代码、文档、日志、artifacts、commit 或 PR body。
196
+ - Hooks 只覆盖 Codex tool loop,不拦截外部 Terminal 手动命令。
197
+
198
+ ## 开发
199
+
200
+ ```bash
201
+ pnpm test
202
+ pnpm lint
203
+ ```
204
+
205
+ 更多文档:
206
+
207
+ - [安装](./docs/install.md)
208
+ - [Local Release Readiness](./docs/local-release-readiness.md)
209
+ - [Source Release Checklist](./docs/release-checklist.md)
210
+ - [自举维护流程](./docs/self-bootstrap.md)
211
+ - [Agent-loop-first Delivery Audit Checklist](./docs/checklists/agent-loop-first-delivery-audit.md)
212
+ - [generic-loop 仓库卫生审计示例](./docs/examples/generic-loop-repo-hygiene.md)
213
+ - [信任与安全](./docs/trust-and-safety.md)
214
+ - [贡献指南](./CONTRIBUTING.md)
215
+ - [安全政策](./SECURITY.md)
package/SECURITY.md ADDED
@@ -0,0 +1,39 @@
1
+ # Security Policy
2
+
3
+ HOLO-Codex is a local-first Codex plugin. It stores runtime state on the user's machine and does not run a hosted service.
4
+
5
+ ## Report A Vulnerability
6
+
7
+ Please report security issues privately to the repository owner before opening a public issue. Include the affected version or commit, a minimal reproduction, and the expected impact.
8
+
9
+ Do not include secrets, dashboard tokens, raw hook payloads, raw transcripts, private prompts, or full worker logs in public reports.
10
+
11
+ ## Sensitive Local Data
12
+
13
+ Never commit or publish:
14
+
15
+ - `.agent-loop/`
16
+ - SQLite state files, WAL/SHM files, or local databases
17
+ - dashboard session tokens
18
+ - MCP tokens or API keys
19
+ - raw hook payloads
20
+ - raw transcript paths or transcript contents
21
+ - raw worker JSONL logs
22
+ - private prompts or private PR review output
23
+
24
+ Use the operating system keychain or your configured secret manager for credentials.
25
+
26
+ ## Hook And Dashboard Boundaries
27
+
28
+ Codex hooks cover Codex tool-loop events only. They do not intercept commands run manually in an external terminal.
29
+
30
+ Dashboard mutations require the local session token and loopback/origin guards. The dashboard URL should not contain the token; the fallback token printed by `agent-loop dashboard` is for local recovery only.
31
+
32
+ ## Public Release Checklist
33
+
34
+ Before publishing a public source snapshot or package:
35
+
36
+ - Run tests and lint.
37
+ - Run a secret/local-state scan.
38
+ - Verify `npm pack --dry-run --json` or the chosen release artifact.
39
+ - Confirm no `.agent-loop` runtime files, dashboard tokens, raw logs, or private handoff documents are included.
@@ -0,0 +1,35 @@
1
+ # HOLO-Codex Brand Assets
2
+
3
+ This folder contains early deterministic SVG drafts for the HOLO-Codex identity.
4
+
5
+ ## Concept
6
+
7
+ The mark combines:
8
+
9
+ - `>_` as the Codex / CLI execution cue.
10
+ - A near-complete loop as the human-on-loop control boundary.
11
+ - An amber intervention dot as the human gate, approval, or pause point.
12
+
13
+ ## Files
14
+
15
+ - `holo-codex-mark.svg` — transparent standalone mark.
16
+ - `holo-codex-icon.svg` — rounded-square app/plugin icon draft.
17
+ - `holo-codex-lockup.svg` — mark plus wordmark and full-name descriptor.
18
+ - `holo-codex-wordmark-options.svg` — wordmark treatment comparison.
19
+ - `holo-codex-social-preview.svg` — 1280x640 GitHub social preview source.
20
+ - `holo-codex-social-preview.png` — GitHub-uploadable social preview export.
21
+ - `holo-codex-readme-hero.svg` — wide README hero banner draft.
22
+ - `holo-codex-plugin-card.svg` — compact plugin marketplace card draft.
23
+
24
+ ## Draft Palette
25
+
26
+ - Ink: `#111827`
27
+ - Supporting text: `#475569`
28
+ - Human gate amber: `#f59e0b`
29
+ - Icon surface: `#f8fafc`
30
+
31
+ ## Notes
32
+
33
+ These are source-hygiene friendly SVG drafts, not final trademark-cleared production identity files. Keep the runtime compatibility names (`agent-loop`, `.agent-loop`, `autonomous-pr-loop`) unchanged unless a migration plan exists.
34
+
35
+ The current wordmark references the restrained Codex product feel without copying an official OpenAI or Codex wordmark. If a final font is selected, convert the wordmark to outlines before publishing release assets that require exact rendering.
@@ -0,0 +1,28 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" role="img" aria-labelledby="title desc">
2
+ <title id="title">HOLO-Codex app icon</title>
3
+ <desc id="desc">A compact HOLO-Codex icon for plugin, app, and favicon use.</desc>
4
+ <rect x="8" y="8" width="112" height="112" rx="28" fill="#f8fafc" />
5
+ <path
6
+ d="M111.3 52.6A49 49 0 1 1 84 19.2"
7
+ fill="none"
8
+ stroke="#111827"
9
+ stroke-width="8"
10
+ stroke-linecap="round"
11
+ />
12
+ <circle cx="98.6" cy="29.4" r="6.5" fill="#f59e0b" />
13
+ <path
14
+ d="M41 48L62 64L41 80"
15
+ fill="none"
16
+ stroke="#111827"
17
+ stroke-width="8"
18
+ stroke-linecap="round"
19
+ stroke-linejoin="round"
20
+ />
21
+ <path
22
+ d="M70 81H91"
23
+ fill="none"
24
+ stroke="#111827"
25
+ stroke-width="8"
26
+ stroke-linecap="round"
27
+ />
28
+ </svg>
@@ -0,0 +1,49 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 160" role="img" aria-labelledby="title desc">
2
+ <title id="title">HOLO-Codex lockup</title>
3
+ <desc id="desc">HOLO-Codex wordmark with terminal prompt loop mark.</desc>
4
+ <g transform="translate(20 16)">
5
+ <path
6
+ d="M111.3 52.6A49 49 0 1 1 84 19.2"
7
+ fill="none"
8
+ stroke="#111827"
9
+ stroke-width="8"
10
+ stroke-linecap="round"
11
+ />
12
+ <circle cx="98.6" cy="29.4" r="6.5" fill="#f59e0b" />
13
+ <path
14
+ d="M41 48L62 64L41 80"
15
+ fill="none"
16
+ stroke="#111827"
17
+ stroke-width="8"
18
+ stroke-linecap="round"
19
+ stroke-linejoin="round"
20
+ />
21
+ <path
22
+ d="M70 81H91"
23
+ fill="none"
24
+ stroke="#111827"
25
+ stroke-width="8"
26
+ stroke-linecap="round"
27
+ />
28
+ </g>
29
+ <g transform="translate(170 47)">
30
+ <text
31
+ x="0"
32
+ y="42"
33
+ fill="#111827"
34
+ font-family="'SF Pro Display', 'OpenAI Sans', Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
35
+ font-size="47"
36
+ letter-spacing="-0.2"
37
+ >
38
+ <tspan font-weight="740">HOLO</tspan><tspan font-weight="570">_Codex</tspan>
39
+ </text>
40
+ <text
41
+ x="2"
42
+ y="78"
43
+ fill="#475569"
44
+ font-family="'SF Pro Text', 'OpenAI Sans', Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
45
+ font-size="18"
46
+ letter-spacing="-0.1"
47
+ >Human On Loop Codex</text>
48
+ </g>
49
+ </svg>