Skip to content

feat(core): structure system context updates - #35045

Closed
kitlangton wants to merge 3 commits into
v2from
system-context
Closed

kitlangton wants to merge 3 commits into
v2from
system-context

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

Summary

  • Structures SystemContext reconciliation output so core can report per-source update metadata alongside the existing joined model-visible text.
  • Adds descriptions for SystemContext producers and item-level changes for list-shaped guidance sources.
  • Keeps the current context-checkpoint event payload unchanged; schema/UI guidance event work remains for WP-F.

Changes

  • packages/core/src/system-context: adds source descriptions, structured reconcile updates, structured update normalization, and diffItems reuse for keyed list diffs.
  • packages/core/src/{instruction-context,system-context/builtins,session/context-entry}: supplies source descriptions.
  • packages/core/src/{skill,reference,mcp}/guidance.ts: supplies source descriptions and item-level structured updates from existing diffByKey results.
  • packages/core/test: covers structured updates, item updates, removal metadata, and updated runner checkpoint snapshots.

Decisions / Deferrals

  • Source descriptions are validated with the same non-empty text guard as rendered context.
  • Removal-capable sources persist descriptions with their removal messages so removed-source updates can still be described after the source disappears.
  • context-checkpoint.ts publish payload is intentionally unchanged in WP-C; WP-F owns the session.guidance.updated schema/UI event swap.
  • No generated clients were regenerated on this branch.

Part of #35017
Part of #35021

Test Plan

  • cd packages/core && bun typecheck
  • cd packages/core && bun run test -- test/system-context/index.test.ts test/instruction-context.test.ts test/session-runner.test.ts
  • bunx prettier --check packages/core/src/system-context/index.ts packages/core/src/skill/guidance.ts packages/core/src/reference/guidance.ts packages/core/src/mcp/guidance.ts packages/core/src/instruction-context.ts packages/core/src/session/context-entry.ts packages/core/src/system-context/builtins.ts packages/core/test/system-context/index.test.ts packages/core/test/instruction-context.test.ts packages/core/test/session-runner.test.ts
  • Pre-push hook: bun turbo typecheck

@kitlangton

Copy link
Copy Markdown
Contributor Author

Closing for now; WP-C is not being pursued in this lane.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant