Skip to content

Commit 8a9c0ef

Browse files
committed
Revert "Merge branch 'main' of https://github.com/lidge-jun/opencodex into fab/00-agent-fabric"
This reverts commit 36c17d0, reversing changes made to ec86646.
1 parent 36c17d0 commit 8a9c0ef

1,454 files changed

Lines changed: 7259 additions & 191825 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/CODEOWNERS

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
# Default reviewers
22
* @lidge-jun @Ingwannu @Wibias
33

4-
# High-impact runtime behavior
5-
/src/adapters/ @lidge-jun @Ingwannu @Wibias
6-
/src/providers/ @lidge-jun @Ingwannu @Wibias
7-
/src/codex/ @lidge-jun @Ingwannu @Wibias
8-
/src/server/ @lidge-jun @Ingwannu @Wibias
9-
104
# Repository automation and release security
115
/.github/ @lidge-jun @Ingwannu
126
/scripts/release.ts @lidge-jun @Ingwannu

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
## Verification
66

77
- List the commands or checks you ran.
8-
- If this PR changes the GUI, include a screenshot of the UI change in the description.
98

109
## Checklist
1110

.github/scripts/copilot-workflows.test.cjs

Lines changed: 0 additions & 82 deletions
This file was deleted.

.github/scripts/enforce-pr-target.test.cjs

Lines changed: 7 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const fs = require("node:fs");
44
const path = require("node:path");
55
const { describe, it } = require("node:test");
66
const assert = require("node:assert/strict");
7-
const { latestCodeRabbitReviewForHead } = require("./pr-quality-state.cjs");
87

98
describe("enforce-pr-target workflow", () => {
109
const workflowPath = path.join(__dirname, "../workflows/enforce-pr-target.yml");
@@ -49,134 +48,14 @@ describe("enforce-pr-target workflow", () => {
4948
assert.match(workflow, /synchronize/);
5049
});
5150

52-
it("uses label events for GUI waivers and a trusted CodeRabbit status signal", () => {
53-
assert.doesNotMatch(workflow, /^ issue_comment:/m);
54-
assert.match(workflow, /- labeled/);
55-
assert.match(workflow, /- unlabeled/);
56-
assert.match(workflow, /^ status:/m);
57-
assert.match(workflow, /github\.event\.context == 'CodeRabbit'/);
58-
assert.match(workflow, /github\.event\.state == 'success'/);
59-
assert.match(workflow, /github\.event\.label\.name == 'gui-screenshot-waived'/);
60-
assert.match(workflow, /listPullRequestsAssociatedWithCommit/);
61-
assert.match(workflow, /candidate\.head\?\.sha === statusSha/);
62-
assert.match(workflow, /candidates\.length !== 1/);
63-
});
64-
65-
it("does not add review events that would break the trusted-base model", () => {
66-
// `pull_request_review` / `pull_request_review_comment` load the workflow
67-
// from the PR head branch (like `pull_request`), while this workflow's
68-
// checkout pins the base SHA — head YAML + base scripts mismatch, so the
69-
// gate crashes (`parseGateState is not a function`) and the head controls
70-
// the workflow definition under a write token. The findings claim runs on
71-
// every `pull_request_target` event instead (opened/edited/synchronize/
72-
// ready_for_review).
73-
assert.doesNotMatch(workflow, /^ pull_request_review:/m);
74-
assert.doesNotMatch(workflow, /^ pull_request_review_comment:/m);
75-
});
76-
77-
it("queries review threads and feeds them to the findings claim check", () => {
78-
// Paginated read: `after: $cursor` + `pageInfo.hasNextPage`, so a busy PR
79-
// with more than 100 threads cannot hide unresolved bot threads (fail-open
80-
// gap in a fail-closed check).
81-
assert.match(workflow, /reviewThreads\(first: 100, after: \$cursor\)/);
82-
assert.match(workflow, /hasNextPage/);
83-
assert.match(workflow, /unresolvedFindingsClaim/);
84-
assert.match(workflow, /findingsClaim\.byBot/);
85-
assert.match(workflow, /review_findings/);
86-
});
87-
88-
it("fails closed when review threads cannot be read", () => {
89-
assert.match(workflow, /findingsUnverifiable/);
90-
assert.match(workflow, /findings claim could not be verified/);
91-
});
92-
93-
it("writes exactly one consolidated comment via a single upsert helper", () => {
94-
assert.match(workflow, /GATE_MARKER,/);
95-
assert.match(workflow, /comment\.body\?\.includes\(GATE_MARKER\)/);
96-
assert.match(workflow, /upsertGateComment/);
97-
assert.match(workflow, /buildGateCommentBody/);
98-
// No legacy two-comment write path remains.
99-
assert.doesNotMatch(workflow, /upsertReadinessComment/);
100-
assert.doesNotMatch(workflow, /buildReadinessCommentBody/);
101-
// No intermediate checkpoint comment writes.
102-
assert.doesNotMatch(workflow, /Draft conversion pending/);
103-
assert.doesNotMatch(workflow, /Recording ownership state/);
104-
});
105-
106-
it("manages the review-ready status label at the ready moment", () => {
107-
assert.match(workflow, /REVIEW_READY_LABEL\s*=\s*"review-ready"/);
108-
assert.match(workflow, /github\.rest\.issues\.addLabels/);
109-
assert.match(workflow, /github\.rest\.issues\.removeLabel/);
110-
assert.match(workflow, /reviewReadyDesired/);
111-
});
112-
113-
it("keeps CodeRabbit auto-review unfiltered so maintainer PRs are not starved", () => {
114-
// A positive `labels:` filter under `reviews.auto_review` in
115-
// `.coderabbit.yaml` would restrict ALL automatic reviews to PRs carrying
116-
// that label. Maintainer PRs never carry `review-ready` (no checklist), so
117-
// such a filter would silently stop CodeRabbit from reviewing maintainer
118-
// PRs. The label is a status marker only; assert the reviewer config
119-
// directly, since the workflow never writes a labels block.
120-
const coderabbit = fs.readFileSync(
121-
path.join(__dirname, "../../.coderabbit.yaml"),
122-
"utf8",
123-
);
124-
const autoReview = coderabbit.match(/auto_review:[\s\S]*?(?=\n\S|\n\s{2}\S)/);
125-
assert.ok(autoReview, ".coderabbit.yaml must declare auto_review");
126-
assert.doesNotMatch(autoReview[0], /labels:/);
127-
});
128-
129-
it("migrates legacy two-comment PRs and deletes the old comments", () => {
130-
assert.match(workflow, /migrateLegacyCommentsIfNeeded/);
131-
assert.match(workflow, /migrateLegacyGateState/);
132-
assert.match(workflow, /github\.rest\.issues\.deleteComment/);
133-
assert.match(workflow, /legacyEnforcerComment/);
134-
assert.match(workflow, /legacyReadinessComment/);
135-
});
136-
137-
it("checks out scripts from the event-specific trusted boundary (never PR head)", () => {
138-
// Scope the assertions to the checkout step itself, so a stray `ref:` on
139-
// another step cannot satisfy the pin while the checkout stays mutable.
140-
const checkoutStep = workflow
141-
.split("- name: Checkout trusted PR-quality scripts")[1]
142-
.split(/\n {6}- name:/)[0];
143-
assert.match(checkoutStep, /actions\/checkout@[0-9a-f]{40}/);
144-
// `pull_request_target` pins the PR base SHA. Trusted `status`
145-
// revalidation has no pull_request payload, so it sources scripts from the
146-
// repository default branch that supplied the privileged workflow itself.
147-
assert.match(
148-
checkoutStep,
149-
/ref:\s*\$\{\{\s*github\.event_name\s*==\s*'status'\s*&&\s*github\.event\.repository\.default_branch\s*\|\|\s*github\.event\.pull_request\.base\.sha\s*\}\}/,
150-
);
151-
assert.doesNotMatch(checkoutStep, /\|\|\s*'dev'/);
152-
// The readiness ping reads MAINTAINERS.md from the same trusted checkout.
153-
assert.match(checkoutStep, /sparse-checkout:\s*\|\s*\n\s*\.github\/scripts\n\s*MAINTAINERS\.md/);
154-
assert.match(checkoutStep, /persist-credentials:\s*false/);
51+
it("checks out trusted default-branch scripts only (never PR head)", () => {
52+
assert.match(workflow, /actions\/checkout@[0-9a-f]{40}/);
53+
assert.match(workflow, /ref:\s*\$\{\{\s*github\.event\.repository\.default_branch\s*\}\}/);
54+
assert.match(workflow, /sparse-checkout:\s*\.github\/scripts/);
55+
assert.match(workflow, /persist-credentials:\s*false/);
15556
assert.doesNotMatch(workflow, /ref:\s*\$\{\{\s*github\.event\.pull_request\.head/);
15657
});
15758

158-
it("orders same-head CodeRabbit reviews deterministically without timestamps", () => {
159-
const head = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
160-
const latest = latestCodeRabbitReviewForHead({
161-
reviews: [
162-
{
163-
id: 41,
164-
commit_id: head,
165-
user: { login: "coderabbitai[bot]" },
166-
body: "older",
167-
},
168-
{
169-
id: 42,
170-
commit_id: head,
171-
user: { login: "coderabbitai[bot]" },
172-
body: "newer",
173-
},
174-
],
175-
liveHeadSha: head,
176-
});
177-
assert.equal(latest?.id, 42);
178-
});
179-
18059
it("loads pr-quality via require from the checked-out scripts", () => {
18160
assert.match(workflow, /pr-quality\.cjs/);
18261
assert.match(workflow, /collectPrQualityFailures/);
@@ -196,9 +75,9 @@ describe("enforce-pr-target workflow", () => {
19675

19776
it("strips stale WRONG BRANCH prefix on failure when base is corrected", () => {
19877
const failureBlock = workflow.match(
199-
/if \(mustDraft\) \{([\s\S]*?)core\.setFailed\(/,
78+
/if \(failures\.length > 0\) \{([\s\S]*?)core\.setFailed\(/,
20079
);
201-
assert.ok(failureBlock, "workflow must have a draft path");
80+
assert.ok(failureBlock, "workflow must have a failure path");
20281
const failurePath = failureBlock[1];
20382
assert.match(failurePath, /shouldStripTitlePrefix/);
20483
assert.match(failurePath, /!hasWrongBase/);

0 commit comments

Comments
 (0)