Skip to content

[codex] add v0.11 context engine - #22

Merged
mattbaconz merged 4 commits into
mainfrom
codex/v0.11-context-engine
May 10, 2026
Merged

mattbaconz merged 4 commits into
mainfrom
codex/v0.11-context-engine

Conversation

@mattbaconz

Copy link
Copy Markdown
Contributor

Summary

Adds the v0.11.0 Context Engine work for Phonton CLI: a token-budgeted worker context compiler, richer prompt manifests, dynamic provider output ceilings, and a benchmark scorer centered on verified success per 10k provider-reported tokens.

This PR also includes the prior CLI active-focus extraction commit from this branch line, so review should consider both the focus-surface refactor and the context-engine commit.

What changed

  • Added typed ContextPlan, ContextPlanItem, and prompt-manifest budget fields in phonton-types.
  • Added deterministic context compilation in phonton-context to build compact repo maps, select bounded code slices, and record omitted candidate tokens.
  • Wired workers to send only selected context slices, show context target/map/code/omitted buckets, and keep prompts diff-minimal.
  • Added dynamic provider completion ceilings for repair, generated-app, and normal tasks.
  • Updated /context, /why-tokens, Flight Log prompt lines, README, changelog, and v0.11.0 release notes.
  • Added scripts/score-benchmark-runs.ps1 for verified_success_per_10k_tokens benchmark scoring.

Validation

  • cargo fmt --all -- --check
  • cargo test --locked -p phonton-cli -p phonton-context -p phonton-worker -p phonton-providers -p phonton-types
  • cargo test --locked --workspace
  • cargo clippy --locked --workspace --all-targets -- -D warnings
  • cargo build --release --locked -p phonton-cli
  • target\release\phonton.exe version
  • target\release\phonton.exe --help
  • npm run test:npm-wrapper
  • npm pack --dry-run
  • scripts\score-benchmark-runs.ps1 smoke fixture: 1 verified run / 5000 tokens => score 2

Notes

No public superiority claim is added. This adds the architecture and benchmark metric needed to test token efficiency against other ADEs with reproducible artifacts.

@mattbaconz
mattbaconz marked this pull request as ready for review May 10, 2026 22:52
@mattbaconz
mattbaconz merged commit eaca8e8 into main May 10, 2026
1 check passed
@mattbaconz
mattbaconz deleted the codex/v0.11-context-engine branch May 10, 2026 22:52

@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: 57b0efa173

ℹ️ 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 +125 to +129
let target = request
.target_tokens
.unwrap_or(DEFAULT_WORKER_CONTEXT_TARGET_TOKENS)
.min(request.budget_limit.unwrap_or(u64::MAX))
.max(512);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Respect hard context limits when compiling prompt targets

The target-budget calculation applies .max(512) after clamping to budget_limit, so any request with budget_limit (or explicit target_tokens) below 512 is silently raised to 512. That violates the documented “hard provider/model context limit” contract and can select context that cannot fit in constrained windows, especially for small-model or test configurations. Clamp the floor before applying the hard limit (or skip the floor when a lower explicit limit is provided).

Useful? React with 👍 / 👎.

$metadata = Read-JsonFile $_.FullName
$usage = Read-JsonFile (Join-Path $runDir "token-usage.json")
$review = Read-JsonFile (Join-Path $runDir "quality-review.json")
$tool = if ($metadata -and $metadata.tool) { [string]$metadata.tool } else { Split-Path (Split-Path $runDir -Parent) -Leaf }

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 Compute fallback benchmark tool key from the correct directory

When metadata.tool is absent, this fallback extracts the parent-of-run parent leaf, which is the task segment for the documented layout benchmarks/runs/<suite>/<tool>/<task>/<run>/..., not the tool segment. As a result, summary grouping is keyed by task name instead of tool name for those runs, producing incorrect score tables whenever metadata is incomplete.

Useful? React with 👍 / 👎.

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