Skip to content

fix(ce-optimize): unique identities, attribute-or-search routing, and tighter activation - #1643

Merged
tmchow merged 10 commits into
mainfrom
tmchow/ce-optimize-forecast-identity-d9b8
Sep 7, 2026
Merged

fix(ce-optimize): unique identities, attribute-or-search routing, and tighter activation#1643
tmchow merged 10 commits into
mainfrom
tmchow/ce-optimize-forecast-identity-d9b8

Conversation

@tmchow

@tmchow tmchow commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

ce-optimize was a generic "try variants" loop. It dropped the estimates it already made, could not tell two dirty worktrees apart, and triggered on jobs that belong to ce-debug or ce-work.

This PR makes the skill do the right job for the target:

  1. Attribute or search. If the target is a named workload's cost, find where the cost is before trying implementations. If it is a scored variant space (prompts, clustering, search), search and keep winners. The skill now states that outcome first, instead of opening as a phase checklist.
  2. Keep the measurements. Each hypothesis has to carry an opportunity record before experiments start, and each comparison has to name the bytes that were actually measured.
  3. Fire on the right job. The description drops synonym catalogs and points diagnosis at ce-debug and known changes at ce-work.

The decide helper, Phase 1 gates, and worker template are unchanged. A follow-on description rewrite lives in #1645.

This PR targets main. It also includes the earlier opportunity-estimate commit that had no PR of its own, and the Cloud Agent environment.json from #1642, which had been merged onto that same un-PRed working branch instead of main.

Review response

  • Wrap-up starts when nothing executable remains, including a backlog of blocked dependencies and locating that cannot be obtained.
  • Implementation is gated on whether locating would change keep or skip, not on the metric being a cost. Directly scored knobs (for example a memory-limit sweep) stay runnable.
  • Re-attribution after a keep runs only when current shares can no longer decide remaining work.
  • Eval needles no longer pass by copying the prompt or refusing the owned path. A later ask to survive every negation of those needles was declined: substring grades cannot close that loop, and a structured field would leak the expected answer.
  • The em-dash / load-bearing pin stays: it is the greppable contract for a constraint this PR introduced.

Validation

  • Targeted ce-optimize + catalog tests: 87 pass
  • Full bun run test: 3652 pass, 1 skip; 3 timeout flakes that pass on isolation rerun (plugin-path, doc-claims-validator, codex-dev collection symlink)
  • git merge-tree of this head into current main is clean
  • Skill-eval pack skipped: no claude / codex / grok on PATH

Security Disclosure

No security-relevant changes. The included environment.json install step is the same Bun install path already reviewed in #1642.

Agent Disclosure

  • Model: Cursor · Cursor Grok 4.6

tmchow and others added 3 commits September 6, 2026 19:21
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Trevin Chow <tmchow@users.noreply.github.com>
…ntities

CP-2 is incomplete without each hypothesis's opportunity record, comparison identities must name the measured bytes, and integrated re-measures append without replacing standalone pairings.

Co-authored-by: Trevin Chow <tmchow@users.noreply.github.com>
@tmchow
tmchow marked this pull request as ready for review September 7, 2026 03:33
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T03:36:36.469738Z 36e4865 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 36e4865d29

ℹ️ 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 thread tests/skill-eval-cell/catalog.ts Outdated
…pine

State the result, next consumer, horizon, and pacing before the phase
machine. Route cost work through locating before implementation search,
and keep scored variant spaces on the search-and-keep path. Rewrite the
model-invoked description as a context pointer instead of jargon or a
synonym catalog.

Co-authored-by: Trevin Chow <tmchow@users.noreply.github.com>
@cursor cursor Bot changed the title fix(ce-optimize): persist forecasts at CP-2 and unique comparison identities fix(ce-optimize): unique identities and attribute-or-search routing Sep 7, 2026

@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: 890a523367

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread skills/ce-optimize/references/loop.md Outdated
Comment thread tests/skill-eval-cell/catalog.ts Outdated
Comment thread tests/skill-eval-cell/catalog.ts Outdated
Relocate persistence procedure to the existing required read and drop
body restatements the opening already decides, so the new outcome spine
fits Codex's 8000-byte prompt cap with headroom.

Co-authored-by: Trevin Chow <tmchow@users.noreply.github.com>

@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: 8a8ef1f265

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread skills/ce-optimize/references/loop.md Outdated
The model-invoked description now states the two real jobs and fences
ce-debug (failing or slow) and ce-work (known change), instead of
synonym catalogs that overfired. Skill prose no longer uses em dashes
or "load-bearing".

Co-authored-by: Trevin Chow <tmchow@users.noreply.github.com>
@tmchow tmchow changed the title fix(ce-optimize): unique identities and attribute-or-search routing fix(ce-optimize): unique identities, attribute-or-search routing, and tighter activation Sep 7, 2026

@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: d32abd8836

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread tests/skills/ce-optimize-decide.test.ts
cursoragent and others added 3 commits September 7, 2026 06:05
Blocked hypotheses can still reach wrap-up. Re-attribution after a keep
runs only when current shares can no longer decide remaining work. Eval
needles no longer pass by parroting the prompt or refusing the path.

Co-authored-by: Trevin Chow <tmchow@users.noreply.github.com>
The result-accounting, cost-attribution, and variant-search rows must
fail when the answer only copies the task or refuses the owned path.

Co-authored-by: Trevin Chow <tmchow@users.noreply.github.com>
The batching forecast used 450 ms, which still contains the substring
50 ms. Shift that range so only the integrated contribution supplies it.

Co-authored-by: Trevin Chow <tmchow@users.noreply.github.com>

@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: 75141ac6d0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread skills/ce-optimize/references/loop.md Outdated
Comment thread skills/ce-optimize/references/loop.md Outdated
Implementation is blocked while locating would change keep or skip, not
because the metric is a cost. Wrap-up starts when nothing executable
remains, including locating that cannot be obtained.

Co-authored-by: Trevin Chow <tmchow@users.noreply.github.com>

@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: c7cdf922ff

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread tests/skill-eval-cell/catalog.ts
@tmchow
tmchow changed the base branch from tmchow/compare-ce-optimize-extreme to main September 7, 2026 06:42
@tmchow
tmchow merged commit 098ccdb into main Sep 7, 2026
4 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 7, 2026
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.

2 participants