Skip to content

feat: add experimental greedy prepare_context (not C3) - #14

Open
guozhihao-224 wants to merge 3 commits into
mainfrom
feat/experimental-prepare-context
Open

feat: add experimental greedy prepare_context (not C3)#14
guozhihao-224 wants to merge 3 commits into
mainfrom
feat/experimental-prepare-context

Conversation

@guozhihao-224

Copy link
Copy Markdown
Collaborator

Summary

  • Pack Memory FTS hits in @powercontext/builtin with a greedy UTF-8 budget (newline join, no mid-entry truncation) and expose ExperimentalRuntime.prepare().
  • Register POST /v1/context/prepare on the experimental subset Server and advertise powercontext.prepared-context.v1 in capabilities.
  • Empty vs ready is honest: no matches or an oversized-only hit returns status: empty, content: null; max_bytes below 512 is 422.
    This is not Python PreparedContext packing parity and not C3.

Profile and parity

Checklist

  • Does not add a second wire contract
  • Does not hand-edit contract/ or conformance/ snapshots
  • Does not hand-edit packages/protocol/src/generated
  • Baseline bump, if any, is this pull request’s only purpose (no bump)
  • New or changed behavior names the compatibility decision or ADR

Test plan

  • pnpm format:write
  • pnpm lint
  • pnpm typecheck
  • pnpm build
  • pnpm test
  • pnpm generate:check
  • CJK remember → prepare_context is ready and content_bytes matches utf8ByteLength
  • no hits → empty / content: null
  • 513-byte hit with max_bytes: 512empty (no truncation)
  • max_bytes: 511 → 422
  • capture still 503; user README still says HTTP Server not shipped

…ch pits.

Port Analyzer v1 and a node:sqlite runtime that can remember and FTS-search
self-created databases, while refusing unstamped Python-like files and
without claiming C3 or shared-database writes.
Expose loopback Fastify health, capabilities, and Memory routes through
protocol validators, without claiming C3 or faking capture/vector success.
Pack FTS hits with core UTF-8 budgets into ready/empty PreparedContext,
without claiming Python packer parity or C3.
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.

SQLite kernel and schema-version gate

1 participant