Conversation
Teingi
marked this pull request as ready for review
September 16, 2026 15:36
Teingi
commented
Sep 16, 2026
…y-understanding # Conflicts: # integrations/codex/plugins/powercontext/hooks/recall.py # tests/test_integration_guidance_evaluation.py
…y-understanding # Conflicts: # src/powercontext/builtin/runtime/application.py # src/powercontext/builtin/runtime/composition.py # src/powercontext/builtin/runtime/prepared_context.py # src/powercontext/builtin/runtime/prepared_text.py # src/powercontext/server/mapping.py # tests/builtin/runtime/test_prepared_context.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue or RFC does this PR close?
Implements the first-phase design in RFC #1619.
Rationale for this change
When an agent resumes a coding task, historical Memory and Handoff material can explain decisions without showing the current implementation. This change lets
prepare_context(include_code=True)add current Python definitions and bounded structural relationships alongside historical context, under one entry and byte budget.What changes are included in this PR?
powercontext code index/statuscommands, and a configured mapping from existing Scopes to Git directories. The index is a rebuildable local cache; no new artifact family, workspace entity, or database table is introduced.include_codeto context preparation, share the existing assembly budget, and retain historical context when code is unavailable or changes during preparation. Normal preparation does not persist code as Sources or Artifacts.powercontext_code_queryMCP tool for status, tree, symbols, callers, callees, impact, affected tests, and bounded source reads. Continuation queries validate the expected fingerprint.Are there any user-facing changes?
The feature is disabled by default. Deployments opt in by configuring a local repository and the separately installed CodeGraph executable, building its index explicitly, and enabling code context for requests or the Codex integration. Existing requests retain their default behavior; there is no database migration.
The initial implementation supports local Python repositories. Refresh is explicit, cache operations use a cache-wide lock, and static relationships are incomplete. Ambiguous same-name relationships are rejected or omitted. The usage guide documents these limits and the supported engine build.
The 12-task paired evaluation ran both settings twice (48 real model runs). Correct definition-file sets were 22/24 without code and 23/24 with code; caller sets were 20/24 and 22/24. All 16 patch checks and 48 regression checks passed. Median end-to-end time increased from 16.32 s to 22.36 s and median input tokens for completed outputs increased from 6,097.5 to 14,240. These small fixture results support keeping the feature opt-in; they do not establish an efficiency gain or justify reducing tests.
How was this change tested?
make check: passed, including type checks. Pre-commit hooks also passed over all 80 changed files, including new files.make contract-test: 48 passed.make docs-test: passed; verified 811 public pages and internal links.POWERCONTEXT_TEST_NATIVE_CODEX=1 uv run pytest tests/e2e/real_experience_skill/test_code_context.py --run-real-e2e --real-e2e-env-file .env -q -s, withPOWERCONTEXT_TEST_CODEGRAPH_EXECUTABLEpointing to the installed engine: passed in 305.81 s. This used the configured OceanBase, LLM and embedding services, actual HTTP/SDK/MCP paths, and native Codex. It verified repair, executable checks, Handoff continuation after a code change, refreshed fingerprints, explicit Source retention after cache removal, automatic-processing exclusion, and subsequent ordinary Source processing. The temporary database was removed and user Codex state was unchanged.Real engine and configured-service tests require explicit local setup and are skipped when their prerequisites are absent. Local validation does not imply that upstream CI has completed.
AI usage statement
Implemented and tested with OpenAI Codex (GPT-6), including code generation, test development, documentation, and command execution. The paired task evaluation used the configured
openai:qwen3.7-plusmodel. Results and limitations are summarized in this PR.