Skip to content

Codex/index prompt rebuild - #43

Closed
waterflane wants to merge 60 commits into
mainfrom
codex/index-prompt-rebuild
Closed

waterflane wants to merge 60 commits into
mainfrom
codex/index-prompt-rebuild

Conversation

@waterflane

Copy link
Copy Markdown
Owner

Summary

Added

  • Added Index v3 structural-first generations containing deterministic
    CodeMaps, a provenance-bearing relationship graph, PageRank/connectivity
    metrics, structural retrieval postings, and a complete orientation map.
  • Added sparse grounded Semantic Cards with code/documentation/config/test
    profiles, item-level validation, one bounded repair, deterministic fallback,
    priority scheduling, and a path-neutral content-addressed cache.
  • Added persisted exact/BM25/graph retrieval with CandidateCards, bounded
    agentic search/symbol/graph/map evidence planning, Working Set and diff
    boosts, and deterministic fallback on every provider or plan failure.
  • Added TokenEstimator, ContextBudget, MAP/SUMMARY/SLICE/FULL representations,
    Context Capsule v2, and stable <contextforge schema_version="2"> prompts.
  • Added public Python map/retrieval/compiler APIs, contextforge map, Capsule v2
    CLI options, read-only MCP and HTTP map/search/symbol/compile operations, and
    Bridge 2.1 with advertised artifact schemas.
  • Added benchmark required ranges, optional files, useful-token accounting,
    file precision/recall, precision@5, range/token precision, model/provider
    calls, lifecycle latency, and ungrounded-claim rate.
  • Added typed evidence/provenance projections to repository maps, normative
    OrientationMap/RepositoryMap schemas, CLI map --kind, and the additive
    benchmark index_v3_capsule pipeline with grounded/dropped-claim metrics.
  • Added off|auto|required model-assisted Evidence Plans, Bridge 2.2 planning
    negotiation, and paired same-model answer regressions with an ordinary
    full-file baseline, range-validated citations, three-vote blinded
    groundedness judging, and phase-separated token accounting.

Changed

  • Index build/update now publish a usable structural generation before semantic
    enrichment. Enrichment failure, timeout, or cancellation leaves that
    structural generation active; old immutable generations remain until explicit
    index clean.
  • Index/manifest/record schemas are version 3. Index v2 is status-readable as
    rebuild_required, excluded from retrieval, rejected by index update, and
    replaced only by a full build without semantic migration.
  • Task-based context suggest and context create default to Index v3 retrieval
    and Capsule v2 when available. --legacy-discovery and --legacy-handoff
    retain the previous flow; manual ContextPackage v1 creation is unchanged.
  • Repository orientation, architecture, conventions, and feature maps are now
    deterministic aggregations of graph, CodeMaps, and grounded cards, without
    separate repository-wide model calls.
  • Semantic enrichment now uses analyzer 7 / semantic-card-v3.4, declaration-
    aware one-to-four chunk planning, full-request/schema token accounting, one
    scheduler-owned repair authority, and lexical anchors for ranking prose.

Fixed

  • Stabilized config-key digests, parse-error reuse, and no-op updates; added
    Kotlin structural extraction and compact bounded occurrence/card evidence.

  • Enforced source-spanning planner previews, session-wide round/action/token
    ceilings, strict whole-plan fallback, model-order materialization, and safe
    FULL → SLICE → MAP downgrade without weakening freshness or hard budgets.

  • Counted response schemas embedded by plain-JSON providers in preflight and
    bounded every agentic round against the provider's complete context window,
    shrinking candidates, module inventory, and previews before dispatch.

  • Corrected paired efficiency measurement to compare Capsule input with the
    ordinary full required/working-file payload rather than the hand-selected
    oracle, while preserving the oracle and blinded judge as quality gates.

  • Added verified non-call reference edges, module-level environment-key facts,
    scoped config-consumer projections, and centrality metrics that exclude both
    inferred and synthetic source-test relationships.

  • Grounded model-inferred relationships in supplied content-addressed targets
    and source evidence, with item-level validation and source/target rename
    rebinding. Updated semantic priority scheduling and behavioral barrel routing.

  • Prevented centrality-only task material, added bounded planner representation
    influence, and enforced a 30% automatic Capsule soft ceiling without weakening
    explicit-material or hard-budget rules.

  • Restricted retrieval graph scoring to verified/best-effort structural edges,
    while retaining inferred neighbors as non-authoritative CandidateCard context.

  • Allocated automatic capsule sections inside the post-envelope soft payload,
    seeded complementary MAPs before upgrades, and penalized duplicate concepts,
    ranges, and graph neighbors during marginal-utility selection.

  • Reported all current v3 repository maps after builds and added a digest-bound
    generated-artifact registry so unchanged package/Capsule/prompt outputs do
    not enter later index updates.

  • Serialized generated-artifact registry updates with a bounded, ownership-
    checked stale-recoverable lock so concurrent writers do not lose entries.

  • Completed twelve-language Python/Tree-sitter import/call/reference extraction,
    ambiguity-aware
    provenance, and key-digest-scoped config-consumer relationships without
    storing configuration values.

  • Sharded graph and retrieval records into digest-bound 4 MiB artifacts,
    removed duplicated generation facts, and made warm retrieval load compact
    file projections plus embedded grounded evidence instead of every CodeMap and
    Semantic Card.

  • Replaced fill-to-30% automatic compilation with minimum-sufficient Evidence
    Plan coverage; the 30% allocation is now a soft ceiling while explicit
    material remains governed by the hard budget.

  • Reused digest-matched published Semantic Cards across unrelated structural
    updates, avoiding retries of unchanged fallback/partial files while still
    rebinding or dropping inferred targets against the current snapshot.

  • Distinguished the closed Semantic Card evidence-ID set from untrusted source
    container IDs, preventing compatible providers from returning transport IDs
    that cannot ground ranking claims.

  • Decoupled Bridge progress delivery from index cancellation: queue overflow
    coalesces intermediate events, counts dropped/coalesced updates, and always
    prioritizes terminal state. A slow progress consumer cannot cancel a job.

  • Separated Bridge client wait timeout, per-provider-attempt timeout, and whole
    operation timeout. Client timeout leaves the job tracked by operation_id
    with its writer lock held through completion/cleanup; explicit cancellation
    and shutdown still cancel it.

Type of change

  • Bug fix
  • Feature
  • Documentation
  • Refactor or maintenance
  • Security hardening without vulnerability details

Validation

  • ruff format --check .
  • ruff check .
  • mypy
  • pytest
  • Documentation/package checks, when applicable
  • Checks did not require a live local or remote model provider

Contributor confirmation

  • This pull request targets dev (unless the maintainer requested
    otherwise).
  • I have the right to submit this contribution under Apache-2.0 as
    described in CONTRIBUTING.md.
  • I did not include credentials, private source, prompts, or unsanitized
    logs.
  • New dependencies or copied assets include compatible provenance and
    licensing information.

@waterflane waterflane closed this Sep 20, 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.

1 participant