Skip to content

Commit 861684e

Browse files
author
jake
committed
feat: upgrade Codex plugin to RLCR v2
1 parent dcbb560 commit 861684e

37 files changed

Lines changed: 4168 additions & 350 deletions

‎.github/workflows/codex-plugin.yml‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ jobs:
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424

25+
- name: Install development checks
26+
run: python3 -m pip install pyright==1.1.411 ruff==0.16.2
27+
28+
- name: Lint and check formatting
29+
run: |
30+
ruff check .
31+
ruff format --check .
32+
33+
- name: Type-check controller
34+
run: pyright
35+
2536
- name: Run native RLCR tests
2637
run: python3 tests/test-codex-native-rlcr.py
2738

@@ -31,10 +42,11 @@ jobs:
3142
python3 -m json.tool plugins/jakeshea-humanize-rlcr/.codex-plugin/plugin.json >/dev/null
3243
python3 -m json.tool plugins/jakeshea-humanize-rlcr/hooks/hooks.json >/dev/null
3344
python3 -m json.tool plugins/jakeshea-humanize-rlcr/schemas/review-v1.json >/dev/null
45+
python3 -m json.tool plugins/jakeshea-humanize-rlcr/schemas/plan-contract-v1.json >/dev/null
3446
3547
- name: Check controller syntax
3648
run: |
3749
python3 -m py_compile \
3850
plugins/jakeshea-humanize-rlcr/controller/*.py \
3951
plugins/jakeshea-humanize-rlcr/scripts/rlcr.py \
40-
plugins/jakeshea-humanize-rlcr/skills/humanize-rlcr/scripts/rlcr.py
52+
plugins/jakeshea-humanize-rlcr/skills/*/scripts/rlcr.py

‎NOTICE.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ The repository descends from:
1010
its upstream plugin metadata.
1111
- GAAC (GitHub-as-a-Context), credited by the upstream Humanize project.
1212

13+
The v2 redesign also studied `humanfia/humanize2` at commit
14+
`72bfb030d423eaecb2ec7589c000483320cfc95e` (Apache-2.0) on 2026-08-26. Its
15+
layering, flow/session, cycle persistence, resuming, reporting, tracing, and
16+
security documentation informed the architecture decision in
17+
`docs/adr/0001-humanize2-pattern-adoption.md`. No Humanize2 source code,
18+
assets, dependency, or executable flow was copied into this plugin; the v2
19+
controller is an independent MIT implementation of selected public design
20+
ideas.
21+
1322
The former Claude Code, Kimi, Gemini, BitLesson, monitoring, and dashboard
1423
implementation was removed from the `for-codex-plugin-only` branch after the
1524
native Codex plugin became self-contained. Original authorship and the complete

‎README.md‎

Lines changed: 86 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# JakeShea Humanize RLCR
22

33
A personal, Codex-only fork of Humanize for bounded plan implementation with
4-
independent review loops.
4+
independent review loops. Version 2 selectively adopts Humanize2's layered
5+
run/cycle, resumability, focused-flow, and traceability patterns while keeping a
6+
smaller fail-closed Codex plugin boundary.
57

68
This repository is not the official PolyArch Humanize distribution. Its Codex
79
identities are deliberately namespaced to avoid collisions with any future
@@ -10,6 +12,8 @@ official plugin:
1012
- Plugin: `jakeshea-humanize-rlcr`
1113
- Marketplace: `jakeshea-humanize`
1214
- Skill: `$jakeshea-humanize-rlcr:humanize-rlcr`
15+
- Planning skill: `$jakeshea-humanize-rlcr:humanize-plan`
16+
- Review-only skill: `$jakeshea-humanize-rlcr:humanize-review`
1317

1418
## What RLCR does
1519

@@ -24,7 +28,20 @@ the same committed artifact:
2428

2529
Both lanes must accept the same immutable artifact digest. Blocking findings
2630
become a continuation prompt; Codex corrects them, commits, and stops again.
27-
The loop is bounded by review rounds, calls, failures, timeouts, and wall time.
31+
The loop is bounded by review rounds, calls, failures, timeouts, wall time, and
32+
measured Codex token usage.
33+
34+
RLCR v2 additionally provides:
35+
36+
- optional `rlcr.plan.v1` contracts whose required criteria are checked by the
37+
controller;
38+
- named deterministic evidence bound to the exact candidate commit;
39+
- independent per-lane caching, so a valid lane is not rerun when its peer
40+
fails transiently;
41+
- typed failures, safe live-review cancellation, explicit session adoption,
42+
and one-way v1 history migration;
43+
- recoverable hash-chained events, run history, Markdown/JSON reports, and
44+
Chrome/Perfetto traces.
2845

2946
## Requirements
3047

@@ -33,18 +50,62 @@ The loop is bounded by review rounds, calls, failures, timeouts, and wall time.
3350
- Git.
3451
- Python 3.10 or newer. Windows hooks use the standard `py -3` launcher.
3552

36-
## Install this checkout
53+
## Install or upgrade the plugin
54+
55+
The plugin is published by this repository's `jakeshea-humanize` marketplace.
56+
The current release has version prefix `0.2.0+codex.`; the suffix is a cache
57+
stamp that changes whenever the local plugin is rebuilt.
58+
59+
### First install from a local checkout
60+
61+
Register the repository marketplace once, then install the plugin:
3762

3863
```bash
3964
codex plugin marketplace add /absolute/path/to/humanize
4065
codex plugin add jakeshea-humanize-rlcr@jakeshea-humanize
4166
```
4267

43-
Open a new Codex conversation, run `/hooks`, inspect and trust the bundled
44-
hook, then invoke:
68+
Verify that Codex reports it as installed and enabled:
69+
70+
```bash
71+
codex plugin list --json
72+
```
73+
74+
### First install directly from GitHub
75+
76+
```bash
77+
codex plugin marketplace add JakeFlasher/humanize --ref for-codex-plugin-only
78+
codex plugin add jakeshea-humanize-rlcr@jakeshea-humanize
79+
```
80+
81+
### Upgrade an existing installation
82+
83+
Finish or cancel an active RLCR run before upgrading because an in-flight run
84+
intentionally refuses changed controller semantics. For a local checkout, pull
85+
or edit the source and reinstall its cache-stamped snapshot:
86+
87+
```bash
88+
git pull --ff-only
89+
codex plugin add jakeshea-humanize-rlcr@jakeshea-humanize
90+
codex plugin list --json
91+
```
92+
93+
Do not add the marketplace again if `codex plugin marketplace list` already
94+
shows `jakeshea-humanize`. For a Git-backed marketplace, refresh it first:
95+
96+
```bash
97+
codex plugin marketplace upgrade jakeshea-humanize
98+
codex plugin add jakeshea-humanize-rlcr@jakeshea-humanize
99+
```
100+
101+
After either installation or upgrade, open a **new Codex conversation** so the
102+
new skills and hook snapshot are loaded. Run `/hooks`, inspect and trust the
103+
bundled Stop hook, then invoke one of the explicit skills:
45104

46105
```text
47106
$jakeshea-humanize-rlcr:humanize-rlcr implement path/to/plan.md
107+
$jakeshea-humanize-rlcr:humanize-plan create a plan and contract for this change
108+
$jakeshea-humanize-rlcr:humanize-review review this committed change against path/to/plan.md
48109
```
49110

50111
For installation from another machine, update, removal, and troubleshooting,
@@ -57,11 +118,11 @@ see [Install for Codex](docs/install-for-codex.md).
57118
plugins/jakeshea-humanize-rlcr/
58119
├── .codex-plugin/plugin.json Plugin identity and UI metadata
59120
├── hooks/hooks.json Native synchronous Stop hook
60-
├── controller/ State machine, review runner, storage
121+
├── controller/ Layered state, policy, evidence, review, reporting
61122
├── prompts/ Independent reviewer lane prompts
62-
├── schemas/review-v1.json Structured reviewer output contract
123+
├── schemas/ Review and plan-contract schemas
63124
├── scripts/rlcr.py Direct controller entrypoint
64-
└── skills/humanize-rlcr/ Explicit Codex skill and wrapper
125+
└── skills/ Plan, review-only, and full-loop skills
65126
tests/test-codex-native-rlcr.py Protocol, concurrency, and safety tests
66127
```
67128

@@ -76,6 +137,9 @@ ${JAKESHEA_HUMANIZE_RLCR_STATE_HOME:-${XDG_STATE_HOME:-~/.local/state}/jakeshea-
76137

77138
```bash
78139
python3 tests/test-codex-native-rlcr.py
140+
ruff check .
141+
ruff format --check .
142+
pyright
79143
python3 -m json.tool .agents/plugins/marketplace.json >/dev/null
80144
```
81145

@@ -96,18 +160,28 @@ codex plugin add jakeshea-humanize-rlcr@jakeshea-humanize
96160
neutralized before trusted Git reads.
97161
- Plan, schema, prompt, manifest, and cumulative patch snapshots are integrity
98162
checked before and after review.
163+
- Start commit ancestry is enforced, and plan contract, run configuration,
164+
evidence manifest, and cumulative patch all contribute to artifact identity.
165+
- Evidence commands run as explicit argv without a shell, at a clean commit;
166+
failed, stale, missing, or tampered records cannot authorize review.
167+
- Live cancellation uses attempt-scoped process registrations and
168+
PID-reuse-resistant kernel identities before signaling a process group.
99169
- Hooks are guardrails, not a complete isolation boundary. The two reviewers
100170
use independent contexts but the same model family; deterministic tests and
101171
human judgment remain necessary.
102172
- Strict mode currently blocks repositories containing Git submodules.
103173

104-
See [Architecture](docs/architecture.md) for the state machine and trust model.
174+
See [Architecture](docs/architecture.md) for the state machine and trust model,
175+
[the Humanize2 adoption ADR](docs/adr/0001-humanize2-pattern-adoption.md) for
176+
the merge decision, [research foundations](docs/research-foundations.md) for
177+
the paper-to-control mapping, and [the v2 migration guide](docs/migration-v2.md)
178+
for upgrades.
105179

106180
## Provenance and license
107181

108182
This personal fork descends from PolyArch Humanize, which itself credits the
109-
GAAC project. The prior Claude Code implementation was removed from this branch
110-
after the Codex-native plugin became self-contained; it remains recoverable in
111-
Git history. See [NOTICE](NOTICE.md).
183+
GAAC project. Humanize2 was studied at a pinned Apache-2.0 revision, but no
184+
Humanize2 source was copied or linked into this MIT plugin. See
185+
[NOTICE](NOTICE.md).
112186

113187
Licensed under the [MIT License](LICENSE).
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# ADR 0001: Selective Humanize2 pattern adoption
2+
3+
- Status: Accepted
4+
- Date: 2026-08-26
5+
- Decision owners: JakeShea Humanize RLCR maintainers
6+
7+
## Context
8+
9+
The prior Humanize repository stopped being the active design center. Its
10+
successor, [humanfia/humanize2](https://github.com/humanfia/humanize2), is a
11+
new Python orchestration product with flows, multiple agent backends, machines,
12+
providers, resumable cycles, a TUI, and trace collection. This plugin is much
13+
narrower: it is a personal Codex-only completion gate driven by one native Stop
14+
hook.
15+
16+
Research and comparison were performed against Humanize2 commit
17+
[`72bfb030d423eaecb2ec7589c000483320cfc95e`](https://github.com/humanfia/humanize2/commit/72bfb030d423eaecb2ec7589c000483320cfc95e),
18+
authored 2026-08-26. The source at that revision is Apache-2.0. The review
19+
covered its normative specifications, layer rules, flow/session model,
20+
concurrency, cycle persistence, resuming, security, reporting, and tracing.
21+
22+
## Decision
23+
24+
Adopt concepts that strengthen a bounded Codex plugin while implementing them
25+
independently in the existing standard-library controller:
26+
27+
| Humanize2 pattern | RLCR v2 application |
28+
| --- | --- |
29+
| Named layers with a directed dependency graph | Domain, configuration, contracts, consensus, evidence, processes, review, storage, reporting, and CLI modules |
30+
| A run captures what it drives before the first turn | Immutable `rlcr.run-config.v1` snapshot and digest |
31+
| Concurrent work means independent sessions | Two fresh reviewer processes, one per named lane, launched concurrently |
32+
| A cycle is an inspectable directory | Private per-run snapshots, rounds, evidence, hash-chained events, history, and reports |
33+
| Resuming is explicit persisted state | Typed phases, crash recovery, infrastructure resume, and explicit session adoption |
34+
| Trace output is portable | Chrome/Perfetto JSON export from controller events |
35+
| Focused flows carry focused skills | Separate explicit plan, review-only, and full RLCR skills |
36+
| Agent capabilities are checked before work | Codex CLI flag preflight and immutable model/effort policy |
37+
38+
Preserve or strengthen the original plugin boundaries:
39+
40+
- reviewers receive a controller-materialized cumulative patch, not a mutable
41+
flow definition;
42+
- repository content is evidence and never executable orchestration;
43+
- reviewer children are read-only, approval-free, strict-configured, and have
44+
hooks, plugins, apps, skills, subagents, image generation, browser use, and
45+
web search disabled;
46+
- deterministic evidence is explicit argv execution at a clean commit and is
47+
cryptographically bound to that commit;
48+
- acceptance remains controller-owned exact consensus, never model prose.
49+
50+
## Deliberately not adopted
51+
52+
- Executable Python flows or third-party flow repositories. Loading repository
53+
orchestration code would violate this plugin's untrusted-repository model.
54+
- Multi-provider accounts, dynamic model discovery, or cross-model fallback.
55+
RLCR intentionally pins `gpt-5.6-sol:xhigh`; silent fallback would change the
56+
review policy mid-run.
57+
- Remote anchors, containers, a TUI, telemetry, or unattended general-purpose
58+
agent execution. They are outside a local completion-gate plugin's scope.
59+
- Humanize2 source code or package dependencies. The implementation is a
60+
clean-room adaptation of public design ideas, remains MIT, supports Python
61+
3.10+, and uses only the standard library at runtime.
62+
63+
## Consequences
64+
65+
The controller has more modules and persisted metadata, but its trust boundary
66+
is narrower and more auditable. Older run snapshots remain readable through a
67+
one-way migration view; active runs still refuse a changed runtime and must be
68+
restarted. The two lanes reduce single-context failure but do not provide
69+
model-family diversity, so deterministic checks and human judgment remain
70+
release requirements.

0 commit comments

Comments
 (0)