Add short-lived zara-context provider #505

Open
nsaspy wants to merge 1 commit from rage/4-context into main
Owner

Implements #4.

Adds a process-local structured context store with explicit provenance, observation/expiry timestamps, confidence, stale-state separation, bounded payloads, and known context categories for application/window/workspace/project/repository/file/selection/clipboard/command/media/call state.

The model-facing surface is read-only: context.current. Desktop/editor/browser/file adapters publish observations through the plugin's structured publish_context() boundary; the tool surface cannot forge trusted observations. Expired values are returned separately as stale rather than silently reused as fresh context, and no context is persisted automatically.

Tests use a fake clock and cover freshness, expiry, filtering, byte/TTL bounds, and cleanup with no sleeps/network/GUI.

Recovered directly onto canonical main after #58 merged; implementation tree is unchanged. Exact recovered candidate head: 465583398b2b6c50d3fa83fc8029843575141447. Merge only after exact-head compatibility/Nix checks are green.

Implements #4. Adds a process-local structured context store with explicit provenance, observation/expiry timestamps, confidence, stale-state separation, bounded payloads, and known context categories for application/window/workspace/project/repository/file/selection/clipboard/command/media/call state. The model-facing surface is read-only: `context.current`. Desktop/editor/browser/file adapters publish observations through the plugin's structured `publish_context()` boundary; the tool surface cannot forge trusted observations. Expired values are returned separately as stale rather than silently reused as fresh context, and no context is persisted automatically. Tests use a fake clock and cover freshness, expiry, filtering, byte/TTL bounds, and cleanup with no sleeps/network/GUI. Recovered directly onto canonical `main` after #58 merged; implementation tree is unchanged. Exact recovered candidate head: `465583398b2b6c50d3fa83fc8029843575141447`. Merge only after exact-head compatibility/Nix checks are green.
feat(context): add short-lived active context provider
Some checks failed
CI / test (pull_request) Failing after 17s
465583398b
Some checks failed
CI / test (pull_request) Failing after 17s
This pull request has changes conflicting with the target branch.
  • plugins.json
  • plugins/zara-context/lib/zara_context/plugin.py
  • plugins/zara-context/lib/zara_context/store.py
  • plugins/zara-context/test/test_context.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin rage/4-context:rage/4-context
git switch rage/4-context

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff rage/4-context
git switch rage/4-context
git rebase main
git switch main
git merge --ff-only rage/4-context
git switch rage/4-context
git rebase main
git switch main
git merge --no-ff rage/4-context
git switch main
git merge --squash rage/4-context
git switch main
git merge --ff-only rage/4-context
git switch main
git merge rage/4-context
git push origin main
Sign in to join this conversation.
No description provided.