Skip to content

feat: add adaptive context productivity evaluation - #99

Open
Coding-Dev-Tools wants to merge 3 commits into
mainfrom
codex/adaptive-context-productivity
Open

feat: add adaptive context productivity evaluation#99
Coding-Dev-Tools wants to merge 3 commits into
mainfrom
codex/adaptive-context-productivity

Conversation

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner

Summary

  • add adaptive prompt-context routing with safe bypass, retrieval, and fallback modes
  • preserve session scope, temporal filters, content-free receipts, and accurate routing savings
  • add a reproducible offline productivity benchmark with correction-loop, telemetry, and model-provenance safeguards

Validation

  • python -m pytest tests/ -q --ignore=tests/test_hosted_evidence.py --ignore=tests/test_hosted_ledger.py --ignore=tests/test_hosted_luna.py
  • python -m pytest tests/test_adaptive_context.py tests/test_productivity_eval.py tests/test_receipts.py -q
  • ruff check engraphis/core/__init__.py engraphis/core/adaptive_context.py engraphis/core/engine.py engraphis/core/grounded.py engraphis/core/store.py engraphis/service.py eval/productivity.py tests/test_adaptive_context.py tests/test_productivity_eval.py
  • python -m eval.productivity --dataset eval/datasets/codemem.jsonl --max-context-tokens 512 --retrieval-token-budget 256

Unrelated, untracked private-evaluation work remains intentionally excluded from this PR.

# Conflicts:
#	README.md
#	engraphis/core/store.py
#	engraphis/dashboard_assets/engraphis-graph.js
#	eval/agent_benchmarks.py
#	eval/benchmark.py
#	eval/context_economy.py
#	eval/longmemeval_v2_evidence.py
#	scripts/install_shortcuts.py
#	tests/test_benchmark_evidence.py
#	tests/test_context_economy.py
#	tests/test_eval_agent_benchmarks.py
#	tests/test_graph_engine_asset.py
#	tests/test_install_shortcuts.py
#	tests/test_longmemeval_v2_evidence.py
#	tests/test_receipts.py

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

ℹ️ 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 engraphis/service.py
Comment on lines +1957 to +1958
for chunk in result.recall.chunks
if chunk.get("id") in packed_ids

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 Keep source metadata in packed citation order

When the context packer's utility ordering differs from recall rank—for example, when a lower-ranked but query-denser memory is packed first—the context labels that memory [1], but this comprehension still makes sources[0] the highest-ranked recalled chunk. Hosts resolving the ordinal against sources will therefore attach the wrong title, ID, and provenance; construct the list by iterating packed_chunks and joining chunk metadata by ID.

AGENTS.md reference: AGENTS.md:L152-L153

Useful? React with 👍 / 👎.

Comment thread eval/productivity.py
Comment on lines +229 to +230
if method == "full_history":
return history, "full_history", 0, ""

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 Enforce the context cap for full-history attempts

When a case's history exceeds max_context_tokens, the full_history branch returns the entire history unchanged; the correction path likewise passes the unbounded history directly at line 421. Those are precisely the workloads meant to exercise adaptive routing, but a hosted agent can reject the oversized prompt and the deterministic benchmark compares strategies under unequal context budgets, invalidating the resulting productivity numbers. Apply the configured cap, or explicitly reject over-budget tasks, on every raw-history attempt.

AGENTS.md reference: AGENTS.md:L154-L155

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