Skip to content

Ship codex/chatgpt-delegate-mode - #135

Merged
Ancienttwo merged 6 commits into
mainfrom
codex/chatgpt-delegate-mode
Jul 29, 2026
Merged

Ship codex/chatgpt-delegate-mode#135
Ancienttwo merged 6 commits into
mainfrom
codex/chatgpt-delegate-mode

Conversation

@Ancienttwo

@Ancienttwo Ancienttwo commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Automated repo-harness ship for codex/chatgpt-delegate-mode.

Checks:

  • Waza /check review artifact recommends pass.
  • A typed AcceptanceReceipt records external pass or the contract-authorized user waiver.
  • contract-worktree finish --no-merge ran the sole sprint verification.
  • merge-gate sealed the exact base/head/full diff locally without another provider call.

This PR intentionally does not merge main locally.


Canary B handoff (Codex built-in browser, run in a Codex session after merge)

  1. Confirm the merged skill is visible: ~/.codex/skills-projected repo-harness-chatgpt routes a delegate mode to references/delegate.md.
  2. In the Codex built-in browser (already signed in to ChatGPT Pro), follow the Codex Host Transport section of delegate.md with this mini brief: new conversation -> record the actually-selected Pro model label -> send: "Delegate-mode transport canary. Reply with exactly two lines: line 1: CANARY-ACK codex-iab transport OK; line 2: ===END OF DELIVERABLE===" -> confirm the /c/ conversation URL before waiting.
  3. Completion authority = visible generation-complete state + the trailing sentinel; extract the reply and verify both lines survive extraction verbatim.
  4. Optionally attach one small staged markdown file to probe the IAB upload path and note any size ceiling observed.
  5. Record outcome (model label evidence, conversation URL, sentinel integrity, upload result) in tasks/notes/ of the consuming session; Claude-side Canary A evidence lives in .ai/harness/chatgpt/sessions/chgpt_20260729_013746_* and chgpt_20260729_014227_followup-*.

…ocol

Add references/delegate.md: 15-rule transport-agnostic protocol (task brief
with EXECUTION_BOUNDARY, sentinel envelope bound to baseline/bundle SHA-256,
baseline snapshot incl. WIP diff, isolated-worktree acceptance chain with no
3-way merge rescue, 2-round escalation semantics, delegation evidence dir under
.ai/harness/chatgpt/delegations/) plus two explicit host transports: Claude via
the existing oracle consult/continue chain (oracle >=0.16 floor, browser-doctor
preflight, provider-session evidence join, followup model-inheritance rule) and
Codex via the built-in browser (visible-completion + sentinel authority).

SKILL.md gains the delegate route, trigger words, and the
consult-stays-planning-only boundary note. Skill-surface pin updated under
contract authority: REFERENCES + delegate.md, router byte limit 2048->2560.
Canary evidence and probe results recorded in the contract notes; deferred
engine work (oracle >=0.16 meta projection, delegate read posture) ledgered in
tasks/todos.md.
@Ancienttwo

Copy link
Copy Markdown
Owner Author

Codex independent acceptance result: BLOCKED; do not merge yet.

Canary B itself passed:

Two P1 blockers remain:

  1. The contract falsifier fired: there is no content-level secret gate on the actual egress bytes. delegate.md lines 34-73 explicitly downgrade the required pre-upload secret scan to manual review. I reproduced this at PR head efef17c9: browser-consult --dry-run accepted an allowed staged TypeScript file containing a synthetic GitHub-token-shaped value, exited 0, and wrote that value into the generated prompt.md. This directly matches the stop condition in tasks/archive/contract-20260729-0201-chatgpt-delegate-mode.md lines 41-43, which says this result requires an engine slice rather than a pure skill-layer closeout. Manual review is not the user-requested fail-closed secret scan.

  2. The canonical delegate skill is not runtime-discoverable. Neither ~/.codex/skills/repo-harness-chatgpt nor the Claude equivalent exists. The package test at tests/skill-surface/chatgpt-package.test.ts lines 134-147 deliberately proves no profile creates a host placement, while the only explicit installer in src/cli/mcp/setup.ts lines 878-907 projects only references/bridge.md as repo-local repo-harness-chatgpt-bridge. Therefore Canary B required manually reading the PR branch; a future Codex task cannot trigger the new delegate mode by skill name. This does not yet replace the repeated hand-written prompt workflow.

Required correction slice:

  • Scan the exact outgoing PromptBundle/prompt bytes before any browser submission; findings or unavailable scanner must fail closed. Add a regression test with a benign allowed filename containing a synthetic secret pattern.
  • Add an explicit, owned projection/install path for the canonical repo-harness-chatgpt package into Codex and Claude skill roots without making it part of default profiles; preserve the repo/package source as the single byte authority and test install/update/uninstall behavior.
  • Reopen/update the archived plan, contract, notes, and review so the fired falsifier and these corrections are represented honestly; then rerun Canary B and the full gates.

Local independent gates at this PR head: bun test 2089 pass / 1 skip / 0 fail; deploy SQL, architecture sync, task sync, strict workflow, inspect state, and adopt dry-run all green. A post-archive verify-sprint invocation exits 1 with No active sprint contract found, consistent with the workflow artifacts already having been archived.

Close the two P1 gaps reproduced by independent acceptance of the delegate
workflow: (1) content-level secrets in allowed staged files could reach the
generated prompt.md — the engine now runs a required Gitleaks scan over the
exact rendered PromptBundle (prompt + inline files + followups) before any
session-store write or provider spawn, fail-closed on missing binary,
incompatible version, unparsable output, or findings, with stdin payload
feeding, isolated config, and a scan receipt (version/source/bytes/sha256);
followup consults inherit the scan requirement from session meta and cannot
opt out. (2) The canonical repo-harness-chatgpt package was absent from host
discovery roots — add explicit opt-in install-skill/uninstall-skill projection
(realpath-validated symlinks to the canonical package, unowned destinations
fail closed, idempotent with rollback), and consolidate canonical source
resolution into chatgpt-skill/source.ts (mcp/setup.ts now consumes it).

Docs updated (delegate.md scan wording, setup.md gitleaks + projection
lifecycle/recovery, browser-engine doc); default install profiles unchanged;
no automatic Gitleaks installation; Oracle metadata projection stays deferred
in tasks/todos.md.
@Ancienttwo
Ancienttwo marked this pull request as ready for review July 29, 2026 09:04
@Ancienttwo
Ancienttwo merged commit 8046045 into main Jul 29, 2026
4 checks passed
@Ancienttwo
Ancienttwo deleted the codex/chatgpt-delegate-mode branch July 29, 2026 09:04

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 322c7abfc7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +227 to +231
}
mkdirSync(dirname(target), { recursive: true });
writeFileSync(target, file.content, 'utf-8');
const stagedBytes = readFileSync(target);
const stagedHash = createHash('sha256').update(stagedBytes).digest('hex');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Hash the bytes that staging actually writes

When an allowed attachment contains non-UTF-8 text, readBrowserInputFile hashes the original bytes but stores a UTF-8-decoded string; this block then re-encodes that string and compares it with the original-byte hash. Such files pass the existing binary/path checks and secret scan but every scan-bound Oracle consult fails with PROMPT_BUNDLE_STAGING_FAILED before submission. Reject invalid UTF-8 during assembly or compute the staging drift check from the same outbound byte representation.

AGENTS.md reference: AGENTS.md:L55-L55

Useful? React with 👍 / 👎.

Ancienttwo added a commit that referenced this pull request Jul 29, 2026
* chore(release): prepare 0.11.3

Release scope v0.11.2..main (PR #135, squash 8046045): repo-owned dual-agent
ChatGPT delegate mode with per-host transports, mandatory fail-closed Gitleaks
egress scan over the exact rendered PromptBundle, explicit host skill
projection commands, and the widened skill-surface pin. Version sources,
localized READMEs, changelog, and the 0.11.3 release filing are updated;
publish remains pending until the filing's release sequence completes.

* chore(release): record 0.11.3 acceptance

* chore(workflow): archive release-0-11-3 closeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant