Skip to content

feat(discovery): [4/5] add WatchRunner, CAS PendingActions, WatchScope, WorkspaceMap, and thread elevation - #7268

Draft
sunrioa wants to merge 4 commits into
apache:mainfrom
sunrioa:feat/discovery-m4-watches-actions
Draft

sunrioa wants to merge 4 commits into
apache:mainfrom
sunrioa:feat/discovery-m4-watches-actions

Conversation

@sunrioa

@sunrioa sunrioa commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Split PR Series (from overview #7200)

Order PR Status Scope Incremental Commit
Independent #7264 Merged Independent — Scheduler stateful script runtime (#7264, merged in 78cc3ec783) 78cc3ec783
1/5 #7265 Draft Discovery 1/5 — Core Dossiers schema (0056), tools, RPCs (47 files, +4,995 / -454) 4200ec8e62
2/5 (on 1/5) #7266 Draft Discovery 2/5 — ChangeTracker (0057), delta header, elastic stopping (30 files, +2,355 / -155) 7b87090438
3/5 (on 2/5) #7267 Draft Discovery 3/5 — Staging sandbox (0058), Wander mode, preferences.md (37 files, +1,809 / -86) 37f2e88111
4/5 (on 3/5) #7268 ← this PR Draft Discovery 4/5 — WatchRunner (0059), PendingActions, WatchScope, WorkspaceMap (64 files, +7,839 / -735) 18b56fff0b
5/5 (on 4/5) #7269 Draft Discovery 5/5 — Pure Frontend Workbench UI & 12-locale i18n (44 files, +4,994 / -281) 21737054c3

Review tip for stacked PRs (2/5–5/5): Because cross-fork PRs target main, click the Incremental Commit link above to review only that PR's isolated diff until its predecessor is merged and rebased.


Summary

Part 4 of 5 of the Proactive Discovery Dossiers stack (stacked on PR #7267; rebased on merged #7264).

  • WatchRunner & CAS PendingActions (0059_discovery_watch_runner.sql): In-place forward migration creating discovery_watches / discovery_pending_actions / authority storage cleanly with upgrade_compat.rs coverage. Adds RegisterWatch, StagePendingAction, confirmPendingAction, and dismissPendingAction with non-boolean JSON input schemas (StagePendingAction.params object schema and PointerEquals.value multi-type schema), compare-and-swap transitions, staleness/input-hash checks, HTTP URL & network-ceiling re-validation on poll execution, and crash-safe receipt handling.
  • Inverted $HOME watching & WatchScope (UpdateWatchScope): Replace recursive $HOME watching with depth-1 NonRecursive subscriptions + eligible content roots, CACHEDIR.TAG filtering, hot-reloadable include/exclude rules, cancellation propagation, and broad-deadline preservation layered cleanly onto feat(scheduler): add structured script payloads, persistent state, concurrency cap, backoff, and dry-run #7264's script payload runtime.
  • Cold-start WorkspaceMap onboarding (DiscoveryMode::Onboard, UpdateWorkspaceMap): Build a durable workspace map for map-driven FollowUp/Wander scheduling with cancellation checks, single-chain deep traversal guidance, and bucket pattern collapsing.
  • Runtime permissions & 12-locale Bot instructions: Wire DossierThreadMode (None / Restricted / Elevated), grant WebFetch/WebSearch when permitted by the network ceiling, and localize Bot discovery coordination instructions across all 12 plugins/agent/facts/locales/ catalogs.

Verification

  • node scripts/i18n/check.mjs — passed (12 locales, 4 catalogs, 1 doc sets)
  • node packages/plugin-sdk/scripts/generate.mjs check & npm run build -w @maka-agent/plugin-sdk — passed
  • node scripts/ci.mjs check format licenses migrations — passed
  • cargo test -p maka-scheduler — 15/15 passed
  • cargo test -p maka-agent-facts -p maka-agent-state — passed
  • cargo test -p maka-agent-native discovery — 56/56 passed (including all_discovery_tool_schemas_avoid_boolean_subschemas)
  • cargo test -p maka-agent-native scheduler — 12/12 passed
  • cargo test -p maka-cli --test upgrade_compat — passed (1/1)
  • node --test products/maka/bundle/tests/recovery-composition.test.mjs — 5/5 passed

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: AI coding assistant helped draft/review portions of the implementation, tests, and multi-locale translations; all diffs and tests were locally verified.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a breaking change or persisted-data migration?

  • Yes — adds additive forward migration 0059_discovery_watch_runner.sql with upgrade_compat.rs coverage described above
  • No

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

…ols, RPCs, and thread elevation (M1)

Generated-by: OpenAI Codex
…stic stopping (M2)

Generated-by: OpenAI Codex
…nd preferences.md (M3)

Generated-by: OpenAI Codex
…kspaceMap, and in-place thread elevation

Generated-by: OpenAI Codex

This branch has not been deployed

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

Labels

effort/XXL Over 2500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant