Skip to content

Commit cf44228

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into feat/priority-levels
2 parents 4ddf4d9 + d24c523 commit cf44228

1,581 files changed

Lines changed: 2283 additions & 168831 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/scripts/pr-quality.test.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ describe("assessPrDescription", () => {
115115
});
116116

117117
describe("collectPrQualityFailures", () => {
118-
const allowed = ["dev", "dev2-go"];
118+
const allowed = ["dev"];
119119

120120
it("reports wrong_base without requiring ancestry inputs", () => {
121121
const failures = collectPrQualityFailures({

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Cross-platform CI
22

33
on:
44
pull_request:
5-
branches: [main, dev, dev2-go]
5+
branches: [main, dev]
66
paths:
77
- "src/**"
88
- "bin/**"

.github/workflows/enforce-pr-target.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
path.join(process.cwd(), ".github", "scripts", "pr-quality.cjs"),
4343
);
4444
45-
const ALLOWED_BASES = ["dev", "dev2-go"];
45+
const ALLOWED_BASES = ["dev"];
4646
const DEFAULT_BASE = "dev";
4747
const TITLE_PREFIX = "[WRONG BRANCH] ";
4848
const COMMENT_MARKER = "<!-- pr-quality-enforcer -->";
@@ -211,7 +211,7 @@ jobs:
211211
"",
212212
`This pull request currently targets ${inlineCode(pr.base.ref)}, but pull requests must target one of ${ALLOWED_BASES.map(inlineCode).join(" or ")}.`,
213213
"",
214-
`@${pr.user.login} Please retarget this PR to ${inlineCode(DEFAULT_BASE)}. Most contributions go to ${inlineCode(DEFAULT_BASE)} first; use ${inlineCode("dev2-go")} only for scoped Go native-port work. \`main\` receives only release promotions. See our [Contributing guide](https://lidge-jun.github.io/opencodex/contributing/) for details. Thanks! 🙏`
214+
`@${pr.user.login} Please retarget this PR to ${inlineCode(DEFAULT_BASE)}. All contributions go to ${inlineCode(DEFAULT_BASE)}; \`main\` receives only release promotions. See our [Contributing guide](https://lidge-jun.github.io/opencodex/contributing/) for details. Thanks! 🙏`
215215
);
216216
}
217217

.github/workflows/service-lifecycle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Service lifecycle
22

33
on:
44
pull_request:
5-
branches: [main, dev, dev2-go]
5+
branches: [main, dev]
66
paths:
77
- "src/service.ts"
88
# Keep in sync with the release.yml service-gate regex (release.yml "Require

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@ dist/
33
.env
44
*.log
55
.DS_Store
6+
7+
# Maintainer-only planning notes. `devlog` is a private submodule
8+
# (lidge-jun/opencodex-internal) pinned by gitlink; its contents are never
9+
# tracked here. Commit inside the submodule, then bump the pointer separately.
610
devlog/
11+
12+
# Scratch space. Security working notes — unreleased findings, draft advisories,
13+
# exploit reasoning, pre-disclosure patch plans — belong here or in a
14+
# `mktemp -d` path, and nowhere else. Not devlog/, not a private repo. See the
15+
# "Security working notes" section of AGENTS.md.
716
.tmp/
817
.opencode/
918

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "devlog"]
2+
path = devlog
3+
url = https://github.com/lidge-jun/opencodex-internal.git
4+
ignore = dirty
5+
update = none
6+
shallow = true

AGENTS.md

Lines changed: 79 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,70 @@ Bun-native TypeScript with no separate server compile step.
1616
`tests/helpers/`, broader scenarios in `tests/e2e-style/`.
1717
- `gui/` — React + Vite dashboard; packaged output is served from `gui/dist`.
1818
- `docs-site/` — public docs (Astro + Starlight), deployed to GitHub Pages.
19-
- `go/` — Go native runtime (primary on the `dev2-go` line during transition).
19+
- `go/` — retired Go native-runtime experiment; kept only where the TypeScript
20+
runtime still references it. New work does not go here.
2021
- `structure/` — maintainer invariants and architecture notes; read before
2122
changing shared subsystems.
2223
- `scripts/` — release and maintenance tooling; `scripts/release.ts` is the
2324
release authority.
24-
- `devlog/` — planning and investigation artifacts (mostly gitignored).
25+
- `devlog/` — maintainer-only planning and investigation notes. This is a
26+
**private submodule** (`lidge-jun/opencodex-internal`), not a directory of
27+
this repository. See "The `devlog` submodule" below.
2528

2629
Read the nearest nested `AGENTS.md` before changing files in a scoped
2730
directory (`src/`, `gui/`, `docs-site/`, `scripts/`, `.github/`).
2831

32+
## The `devlog` submodule
33+
34+
Planning notes, triage matrices, and investigation artifacts live in the private
35+
`lidge-jun/opencodex-internal` repository, wired in as the `devlog` submodule.
36+
They quote live infrastructure state, provider behaviour, unfixed defects, and
37+
internal triage reasoning, so a public clone should carry the runtime and its
38+
docs and nothing else.
39+
40+
The pointer is deliberately **loose**, so a missing or stale `devlog` can never
41+
fail a check:
42+
43+
- `.gitmodules` declares `ignore = dirty`, `update = none`, and `shallow = true`.
44+
A dirty or moved submodule working tree does not show up in `git status` on
45+
the parent, and `git submodule update` will not touch it unless asked
46+
explicitly.
47+
- No workflow checks it out. `actions/checkout` runs without `submodules:`, so
48+
CI clones the public tree only and the private URL is never resolved.
49+
- Nothing in the build, test, typecheck, or privacy-scan path reads from
50+
`devlog/`. Contributors without access see an empty directory and every gate
51+
still passes.
52+
- `devlog/` stays listed in `.gitignore` for the working tree; the submodule
53+
gitlink is tracked, its contents are not.
54+
55+
Two rules keep it that way. Never commit anything under `devlog/` to *this*
56+
repository — commit inside the submodule, then update the pointer here as a
57+
separate commit. And never nest a git repository inside the submodule: a
58+
`160000` gitlink in a tree that CI does not initialize breaks
59+
`actions/checkout` for every contributor, which is exactly what happened before
60+
this split.
61+
62+
## Security working notes
63+
64+
**Security work is done in scratch space, never in a tracked directory.** That
65+
includes unreleased findings, severity assessments, draft advisories, exploit
66+
or bypass reasoning, reproduction steps for an unfixed defect, and
67+
pre-disclosure patch plans.
68+
69+
Use `.tmp/` in the working tree (already gitignored) or a `mktemp -d` path.
70+
`devlog/` is **not** an acceptable location, and neither is a private
71+
repository: both get cloned across machines and CI, both outlive the embargo,
72+
and neither history is practical to purge afterwards.
73+
74+
Only the published outcome reaches a repository — the fix itself, its
75+
regression test, the release note, the advisory once it is public. Draft the
76+
advisory in scratch space and delete the scratch directory once the advisory is
77+
live.
78+
79+
This applies to `AGENTS.md`-following agents as much as to humans. If a task
80+
asks you to write up a security finding, put the write-up in scratch space and
81+
say where it is; do not add it to `devlog/`, `structure/`, or `docs-site/`.
82+
2983
## Commands
3084

3185
```bash
@@ -42,34 +96,29 @@ non-trivial change. CI runs these on Linux, Windows, and macOS.
4296

4397
## Branch policy
4498

45-
- `dev` — integration branch and the default target. A pull request goes here
46-
unless it belongs to a scoped line below.
47-
- `dev2-go` — parallel integration line for the Go native port: `go/`,
48-
`bin/native-runtime.mjs`, `src/lib/runtime-entry.ts`, and the Go
49-
release-asset tooling. Open for pull requests: the target-branch check
50-
accepts `dev` and `dev2-go` as integration targets. Keep it to scoped Go
51-
native-port work — the check cannot tell an intentional target from a
52-
mistaken one, so that boundary is a review decision. It converges back
53-
through maintainer-controlled merges, and promotion to `main` still happens
54-
only from `dev`.
99+
- `dev` — the single integration branch and the target for every pull request.
55100
- `main` — release branch. It only moves by maintainer-controlled promotion
56101
from `dev` (releases, docs deploys). Do not open feature PRs against `main`.
57102
- `preview` — prerelease train (`x.y.z-preview.*` versions).
58103

59-
### Transition to `dev2-go`
104+
### The retired `dev2-go` line
105+
106+
The project previously ran a parallel `dev2-go` integration line that was
107+
rebuilding the runtime as a Go native port, and every merge into `dev` had to be
108+
carried onto it. That dual-track policy is over: maintaining two integration
109+
lines cost more than the port returned, and dogfooding the Go runtime kept
110+
surfacing new defects.
60111

61-
The project is moving its primary runtime to the Go native port, so `dev2-go`
62-
has to keep receiving everything that lands on `dev`. Pull requests against
63-
`dev` stay welcome and unchanged — the extra work belongs to the maintainer who
64-
merges them.
112+
`dev2-go` has been deleted, along with the `codex/260728-go-port-*` and
113+
`tmp/dev2-go-source-export` side branches. The full history lives in
114+
[lidge-jun/opencodex-go-archive](https://github.com/lidge-jun/opencodex-go-archive)
115+
and the final tip is tagged `archive/dev2-go` in this repository. There is no
116+
carry or port obligation attached to a `dev` merge any more, and the
117+
`needs-go-port` label is gone.
65118

66-
A merge into `dev` does not finish the task. The merging maintainer also
67-
rebases that work onto `dev2-go`, ports whatever needs a Go counterpart under
68-
`go/`, and merges the port. The item is done only when both lines carry the
69-
change. If a change has no Go counterpart, say so in the merge or tracking
70-
issue; if the port has to wait, open a `needs-go-port` tracking issue against
71-
`dev2-go` naming the source commits before closing out the `dev` merge.
72-
[`MAINTAINERS.md`](./MAINTAINERS.md) holds the authoritative wording.
119+
Bun-native TypeScript is the only runtime line. If native code returns, the
120+
expectation is an incremental module (for example Rust via N-API) landing on
121+
`dev`, not a second full-runtime branch.
73122

74123
The Claude Desktop integration formerly carried on the `claudedesktop` branch is
75124
now fully merged into `dev`, and that branch has been retired. Desktop work
@@ -81,10 +130,10 @@ is ordinary maintenance rather than noise — open it as a normal pull request
81130
and name the source commits in the description.
82131

83132
The **`enforce-target`** CI check rejects pull requests whose head
84-
ancestry sits on the **`main`** tip while far behind **`dev`** or **`dev2-go`**,
85-
and rejects empty, thin, or malformed descriptions; authors with repository
86-
push permission skip the ancestry heuristic only. As with approval requirements
87-
in [`MAINTAINERS.md`](./MAINTAINERS.md), this is enforced by convention until
133+
ancestry sits on the **`main`** tip while far behind **`dev`**, and rejects
134+
empty, thin, or malformed descriptions; authors with repository push permission
135+
skip the ancestry heuristic only. As with approval requirements in
136+
[`MAINTAINERS.md`](./MAINTAINERS.md), this is enforced by convention until
88137
branch protection is configured.
89138

90139
[`MAINTAINERS.md`](./MAINTAINERS.md) is authoritative for review and merge
@@ -100,12 +149,8 @@ reviewers (Codex, CodeRabbit).
100149
language. Be detailed and specific: name the file and line, describe the
101150
concrete failure mode, and suggest a fix. Avoid vague or purely stylistic
102151
commentary.
103-
- **Branch targeting:** flag any pull request that targets neither `dev` nor
104-
`dev2-go` (releases and maintainer promotions are the only exceptions).
105-
`dev2-go` is accepted by the automation but scoped by review: if a pull
106-
request targets it without touching `go/`, the native runtime entrypoint, or
107-
the Go release-asset tooling, ask the author to retarget to `dev`. The
108-
automation cannot make that judgement, which is why it is yours.
152+
- **Branch targeting:** flag any pull request that does not target `dev`
153+
(releases and maintainer promotions are the only exceptions).
109154
- **Security boundary (highest priority):** changes touching authentication,
110155
credential/token handling, OAuth flows, GitHub Actions workflows, release
111156
automation (`scripts/release.ts`, `.github/workflows/release.yml`), or

CONTRIBUTING.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,17 @@ Thanks for helping with opencodex.
1010

1111
## Branches
1212

13-
- `dev` — default integration target for pull requests.
14-
- `dev2-go` — parallel integration line for the Go native port (`go/`, the
15-
native runtime entrypoint, and the Go release-asset tooling). Open for pull
16-
requests alongside `dev`. Send work here only when it belongs to the Go port;
17-
anything else goes to `dev`. The automated check accepts both targets and
18-
cannot tell them apart, so scope is settled in review.
13+
- `dev` — the only integration target for pull requests.
1914
- `main` — releases only; moves by maintainer-controlled promotion from `dev`.
2015
- `preview` — prerelease train.
2116

22-
While the project moves its primary runtime to the Go native port, `dev2-go`
23-
has to keep receiving everything that lands on `dev`. Nothing changes for
24-
contributors: keep opening pull requests against `dev`. After merging, a
25-
maintainer rebases the work onto `dev2-go` and ports whatever needs a Go
26-
counterpart, and the item is finished only once both lines carry it. See
27-
[`MAINTAINERS.md`](./MAINTAINERS.md) for the full rule.
17+
The `dev2-go` Go native-port line has been retired. Its history is archived at
18+
[lidge-jun/opencodex-go-archive](https://github.com/lidge-jun/opencodex-go-archive),
19+
and everything now goes to `dev`. See [`MAINTAINERS.md`](./MAINTAINERS.md) for
20+
the reasoning.
2821

29-
Porting and rebase pull requests are welcome: carrying a fix across integration
30-
lines, or rebasing a stale branch onto the current head, is normal
31-
contribution. Note the source commits in the description.
22+
Rebase pull requests are welcome: bringing a stale branch onto the current head
23+
is normal contribution. Note the source commits in the description.
3224

3325
Agent-facing repository and review rules live in [`AGENTS.md`](./AGENTS.md).
3426

0 commit comments

Comments
 (0)