minutework 0.1.46 → 0.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/claude-local/CLAUDE.md.template +4 -0
- package/assets/claude-local/skills/README.md +2 -0
- package/assets/claude-local/skills/app-pack-authoring/SKILL.md +4 -2
- package/assets/claude-local/skills/attached-app/SKILL.md +161 -0
- package/assets/claude-local/skills/capability-gap-reporting/SKILL.md +6 -2
- package/assets/claude-local/skills/cross-server-subscriptions/SKILL.md +135 -0
- package/assets/claude-local/skills/dataset-subscriber-flow/SKILL.md +186 -0
- package/assets/claude-local/skills/event-bus/SKILL.md +70 -0
- package/assets/claude-local/skills/layering-and-import-modes/SKILL.md +7 -2
- package/assets/claude-local/skills/project-overview-and-strategy/SKILL.md +7 -0
- package/assets/claude-local/skills/runtime-capability-inventory/SKILL.md +20 -12
- package/assets/claude-local/skills/runtime-capability-inventory/primitive-catalog.json +28 -28
- package/assets/claude-local/skills/solution-router/SKILL.md +124 -0
- package/assets/templates/vuilder-shell/src/app/app/demo/page.tsx +9 -0
- package/assets/templates/vuilder-shell/src/features/demo/components/manifest-demo.tsx +79 -0
- package/dist/cli-json.d.ts +1 -1
- package/dist/cli-json.js.map +1 -1
- package/dist/developer-client.d.ts +29 -0
- package/dist/developer-client.js +35 -0
- package/dist/developer-client.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/workspace.d.ts +3 -0
- package/dist/workspace.js +115 -2
- package/dist/workspace.js.map +1 -1
- package/package.json +3 -3
- package/vendor/workspace-mcp/context.d.ts +4 -1
- package/vendor/workspace-mcp/context.js +4 -0
- package/vendor/workspace-mcp/context.js.map +1 -1
- package/vendor/workspace-mcp/discovery-status.d.ts +16 -0
- package/vendor/workspace-mcp/discovery-status.js +259 -0
- package/vendor/workspace-mcp/discovery-status.js.map +1 -0
- package/vendor/workspace-mcp/index.d.ts +2 -1
- package/vendor/workspace-mcp/index.js +1 -0
- package/vendor/workspace-mcp/index.js.map +1 -1
- package/vendor/workspace-mcp/server.js +9 -1
- package/vendor/workspace-mcp/server.js.map +1 -1
- package/vendor/workspace-mcp/types.d.ts +119 -0
- package/vendor/workspace-mcp/types.js +24 -0
- package/vendor/workspace-mcp/types.js.map +1 -1
|
@@ -69,6 +69,10 @@ coding agent can use them as reference: browse `skills/` and read the relevant
|
|
|
69
69
|
automatically and `/skill-name` invokes one directly; other agents (Codex,
|
|
70
70
|
Cursor) can open the files directly or ask "What skills are available?".
|
|
71
71
|
|
|
72
|
+
When the task involves event-driven behavior or reacting to external/reference
|
|
73
|
+
datasets, read `skills/event-bus/SKILL.md` and
|
|
74
|
+
`skills/cross-server-subscriptions/SKILL.md`.
|
|
75
|
+
|
|
72
76
|
## Capability Gaps
|
|
73
77
|
|
|
74
78
|
When a request exposes missing shared MinuteWork substrate, read
|
|
@@ -53,6 +53,8 @@ Generated-workspace-first guidance should live here, especially:
|
|
|
53
53
|
- `shell-architecture/SKILL.md`
|
|
54
54
|
- `runtime-capability-inventory/SKILL.md`
|
|
55
55
|
- `runtime-primitive-interim-paths/SKILL.md`
|
|
56
|
+
- `solution-router/SKILL.md`
|
|
57
|
+
- `attached-app/SKILL.md`
|
|
56
58
|
- `integration-broker-and-connectors/SKILL.md`
|
|
57
59
|
- `layering-and-import-modes/SKILL.md`
|
|
58
60
|
- `standalone-mobile-client/SKILL.md`
|
|
@@ -93,11 +93,13 @@ An `app pack` is the shipped product unit.
|
|
|
93
93
|
infer access policy from artifact metadata.
|
|
94
94
|
- Public-site authoring should stay CMS/runtime-backed, while anonymous live
|
|
95
95
|
delivery should prefer published snapshots.
|
|
96
|
-
- Prefer this decision order before writing greenfield code
|
|
96
|
+
- Prefer this decision order before writing greenfield code (route a fresh
|
|
97
|
+
request through `solution-router/SKILL.md` first):
|
|
97
98
|
- reuse existing MinuteWork substrate or a reviewed capability skill
|
|
98
99
|
- extend app-pack/schema/flow surfaces
|
|
99
100
|
- adopt a strong OSS library or product when it clearly fits
|
|
100
|
-
- use `attached_app` when the foreign system should stay its own subsystem
|
|
101
|
+
- use `attached_app` when the foreign system should stay its own subsystem;
|
|
102
|
+
see `attached-app/SKILL.md` for the authoring procedure
|
|
101
103
|
- use repo intake or greenfield code only when the cleaner options do not fit
|
|
102
104
|
- If a mature OSS product already solves the problem well, prefer integrating,
|
|
103
105
|
wrapping, or governing it instead of rebuilding it from scratch.
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: attached-app
|
|
3
|
+
description: "Authoring a governed control surface around a mature foreign subsystem the tenant hosts: declare attachment, bridge, projection, and health metadata; compile to a declarative or hybrid app pack plus subordinate metadata; never a new app class."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Attached App
|
|
7
|
+
|
|
8
|
+
Use this skill when a mature foreign subsystem the tenant already hosts should
|
|
9
|
+
stay its own system of record while MinuteWork compiles a governed control
|
|
10
|
+
surface around it -- typed actions, governed reads, policy, federation -- rather
|
|
11
|
+
than rewriting it natively or reshaping it into a sidecar. Reach this skill
|
|
12
|
+
through `solution-router/SKILL.md` once the selected mode is `attached_app`.
|
|
13
|
+
|
|
14
|
+
## The boundary (read first)
|
|
15
|
+
|
|
16
|
+
These rules are non-negotiable; an attach that breaks one has become a second
|
|
17
|
+
install system:
|
|
18
|
+
|
|
19
|
+
- `attached_app` is a deployment and authoring **mode**, not an `app_class`. It
|
|
20
|
+
never becomes `app_class = attached_app`; it compiles to an existing class --
|
|
21
|
+
normally `declarative` or `hybrid` -- plus **subordinate** attachment
|
|
22
|
+
metadata. It is never a parallel activation path.
|
|
23
|
+
- the foreign system may remain the domain-data system of record, but it is not
|
|
24
|
+
itself the trusted install contract. The compiled manifest graph is the only
|
|
25
|
+
authoritative activation surface.
|
|
26
|
+
- generated APIs stay manifest-driven even here: reads come from `QueryManifest`,
|
|
27
|
+
writes from `ActionManifest`, custom routes from `RouteManifest`, and docs
|
|
28
|
+
derive from the active schema and manifests.
|
|
29
|
+
- the foreign subsystem must report healthy through its **declared health
|
|
30
|
+
checks** before the generated manifests may become `active`.
|
|
31
|
+
|
|
32
|
+
## When to use, and when not
|
|
33
|
+
|
|
34
|
+
Use when the upstream system is already mature and intact, rewriting it would be
|
|
35
|
+
wasteful, the tenant wants AI control/governance/federation over it more than a
|
|
36
|
+
deep rewrite, and it can keep its own subsystem boundary while exposing typed
|
|
37
|
+
verbs through a generated adapter.
|
|
38
|
+
|
|
39
|
+
Do not use when:
|
|
40
|
+
|
|
41
|
+
- the system is a remote third-party SaaS reached over its API -- that is a
|
|
42
|
+
`connector`, not an attach.
|
|
43
|
+
- the tenant wants MinuteWork to own the data natively from day one -- that is
|
|
44
|
+
build-native / `native_pack`.
|
|
45
|
+
- the code is unfinished and you would clone it to co-develop it -- that is
|
|
46
|
+
`external_repo_intake` toward a code-backed pack, a different combination on a
|
|
47
|
+
different axis. Attach a system **once it is a working, intact subsystem**
|
|
48
|
+
(build-then-attach), not before.
|
|
49
|
+
|
|
50
|
+
## Authoring procedure
|
|
51
|
+
|
|
52
|
+
The procedure is identical for every domain. All domain identity comes from the
|
|
53
|
+
selected reviewed instance and the manifests the tenant authors -- never from
|
|
54
|
+
this skill.
|
|
55
|
+
|
|
56
|
+
### Step 1 -- Identify the foreign subsystem
|
|
57
|
+
|
|
58
|
+
Confirm it is mature, intact, and tenant-hosted, with a typed surface (an HTTP
|
|
59
|
+
API, a DRF layer, an ORM the adapter can reach). Capture its base location and
|
|
60
|
+
how it authenticates as a **secret reference**, never a literal credential (see
|
|
61
|
+
`secrets-runtime-bridge/SKILL.md`). If credentials, provider writes, spend, or
|
|
62
|
+
audit receipts are involved, route the adapter through broker substrate (see
|
|
63
|
+
`integration-broker-and-connectors/SKILL.md`).
|
|
64
|
+
|
|
65
|
+
### Step 2 -- Declare the subordinate attachment metadata
|
|
66
|
+
|
|
67
|
+
These are subordinate documents and refs inside the standard graph, not a second
|
|
68
|
+
pipeline:
|
|
69
|
+
|
|
70
|
+
- `AttachedApp` -- the foreign base plus its auth reference.
|
|
71
|
+
- `BridgeAdapter` -- how typed verbs reach the foreign system.
|
|
72
|
+
- `ProjectionContract` -- the governed projected read shape: safe summaries,
|
|
73
|
+
receipts, and selected previews. It does not imply a one-to-one mirror of
|
|
74
|
+
every foreign table or endpoint.
|
|
75
|
+
- declared health checks -- the endpoints that define "ready."
|
|
76
|
+
- optional `PolicyLayer` / `ProjectionPolicy` for bounds and redaction.
|
|
77
|
+
|
|
78
|
+
### Step 3 -- Emit the standard governed artifact graph
|
|
79
|
+
|
|
80
|
+
- `AppManifest` with `app_class = declarative` or `hybrid` (`hybrid` when
|
|
81
|
+
runtime-native records or code sit alongside the projection).
|
|
82
|
+
- `ActionManifest` for every write/mutation verb.
|
|
83
|
+
- `QueryManifest` for every read.
|
|
84
|
+
- `RouteManifest` for internal callbacks or bounded adapter routes.
|
|
85
|
+
- `FlowManifest` for sync cadence, retry, and operator-escalation runbooks.
|
|
86
|
+
- `OntologyMappingManifest` mapping foreign objects onto shared URNs.
|
|
87
|
+
- `ProjectionContract` and a `PromotionRule` set.
|
|
88
|
+
- optionally a tenant-facing `SkillManifest` for operator/downstream-agent verbs.
|
|
89
|
+
|
|
90
|
+
### Step 4 -- Wire the health gate
|
|
91
|
+
|
|
92
|
+
Bind the declared health checks so the foreign subsystem must report ready
|
|
93
|
+
before activation. On a failed or unready check the install parks in a retriable
|
|
94
|
+
non-active state -- never a silent activate. An attach into an already-active
|
|
95
|
+
workspace must health-gate the new attached surface without disturbing the
|
|
96
|
+
existing active app.
|
|
97
|
+
|
|
98
|
+
## Worked examples (illustrative instances, not framework)
|
|
99
|
+
|
|
100
|
+
Two different domains run through the **same** Steps 1-4 above; only the selected
|
|
101
|
+
instance and the authored manifests change. These are reviewed-skill instances,
|
|
102
|
+
not part of the framework.
|
|
103
|
+
|
|
104
|
+
### Example A -- a self-hosted commerce backend
|
|
105
|
+
|
|
106
|
+
*Illustrative instance, e.g. the `commerce.medusa_attached_app` reviewed seed --
|
|
107
|
+
not framework.* A tenant self-hosts a mature commerce engine and wants AI to
|
|
108
|
+
operate merchant workflows while the engine stays the system of record. Author:
|
|
109
|
+
`AttachedApp` + `BridgeAdapter` over the engine; a `ProjectionContract` for
|
|
110
|
+
order/inventory summaries and receipts; health checks on the engine; an
|
|
111
|
+
`AppManifest` (`hybrid`); `ActionManifest` writes (e.g. `commerce.create_product`,
|
|
112
|
+
`commerce.issue_refund`) bounded by policy (refunds above a threshold require
|
|
113
|
+
approval); `QueryManifest` reads (e.g. `commerce.list_orders`,
|
|
114
|
+
`commerce.low_inventory_report`); `FlowManifest` recovery runbooks. Compiles
|
|
115
|
+
`hybrid` + subordinate attachment metadata.
|
|
116
|
+
|
|
117
|
+
### Example B -- a self-hosted regulatory data-plane
|
|
118
|
+
|
|
119
|
+
*Illustrative instance, e.g. the `datalake.fmcsa_attached_app` reviewed seed --
|
|
120
|
+
not framework.* A tenant self-hosts a large regulatory dataset subsystem
|
|
121
|
+
(scheduled ingestion, a relational store) and wants other runtimes and agents to
|
|
122
|
+
query it through governed verbs while it stays the system of record. Author:
|
|
123
|
+
`AttachedApp` + `BridgeAdapter` over the data-plane; a `ProjectionContract` for
|
|
124
|
+
freshness, receipts, and safe summaries; health checks on ingestion/query;
|
|
125
|
+
an `AppManifest` (`hybrid`); `ActionManifest` writes (e.g. `datalake.run_sync`,
|
|
126
|
+
`datalake.import_slice`) where broad import/copy requires approval;
|
|
127
|
+
`QueryManifest` reads (e.g. `datalake.lookup_carrier`, `datalake.sync_status`);
|
|
128
|
+
`FlowManifest` sync-cadence runbooks. Compiles `hybrid` + subordinate attachment
|
|
129
|
+
metadata.
|
|
130
|
+
|
|
131
|
+
Swap Example A for Example B and Steps 1-4 are unchanged. If your procedure only
|
|
132
|
+
works for one of them, a domain has leaked into the mechanics -- pull it back
|
|
133
|
+
into the instance and the manifests.
|
|
134
|
+
|
|
135
|
+
## Current status / honest caveat
|
|
136
|
+
|
|
137
|
+
Today the runtime does **not yet** honor subordinate attachment metadata or
|
|
138
|
+
health-gate activation, and the runtime `app_class` set does not yet include
|
|
139
|
+
`hybrid` (it carries `declarative` and `sidecar` only). You can **draft** the
|
|
140
|
+
full governed attach graph now -- `AttachedApp`/`BridgeAdapter`/`ProjectionContract`/
|
|
141
|
+
health checks plus the Action/Query/Route/Flow/Ontology manifests -- but full
|
|
142
|
+
end-to-end execution (the installer consuming the metadata, and activation
|
|
143
|
+
blocking on foreign health) depends on that runtime work landing. State this
|
|
144
|
+
plainly to the tenant: an attach you author now is a governed draft, not a live,
|
|
145
|
+
health-gated integration. If the gap blocks the tenant, record it (see
|
|
146
|
+
`capability-gap-reporting/SKILL.md`).
|
|
147
|
+
|
|
148
|
+
## Related skills
|
|
149
|
+
|
|
150
|
+
- `solution-router/SKILL.md` -- how a request gets routed to `attached_app` in
|
|
151
|
+
the first place, and the connector/sidecar/intake alternatives.
|
|
152
|
+
- `layering-and-import-modes/SKILL.md` -- where attach sits in the configure ->
|
|
153
|
+
app-pack -> overlay -> attach -> intake -> greenfield order.
|
|
154
|
+
- `app-pack-authoring/SKILL.md` -- the shipped app-pack artifact family the
|
|
155
|
+
attach graph compiles into.
|
|
156
|
+
- `secrets-runtime-bridge/SKILL.md` -- referencing the foreign system's
|
|
157
|
+
credentials without embedding them.
|
|
158
|
+
- `ontology-mapping/SKILL.md` -- mapping foreign objects onto shared URNs.
|
|
159
|
+
- If this skill is missing from an older generated workspace, refresh managed
|
|
160
|
+
guidance with `minutework workspace sync-assets`
|
|
161
|
+
(see `workspace-guidance-refresh/SKILL.md`).
|
|
@@ -78,13 +78,17 @@ open GitHub PRs, or require monorepo permissions for capability gaps.
|
|
|
78
78
|
gateway, ingress, workflow, thread, or AI substrate, but not yet a built-in
|
|
79
79
|
baseline product capability.
|
|
80
80
|
- `reviewed_skill` when the missing piece is Builder-side routing or solution
|
|
81
|
-
guidance rather than runtime/platform substrate
|
|
81
|
+
guidance rather than runtime/platform substrate (see
|
|
82
|
+
`solution-router/SKILL.md` for how reviewed skills are ranked and selected).
|
|
82
83
|
- `app_pack` when the missing reusable thing should land as an installable
|
|
83
84
|
product capability rather than a lower-level primitive.
|
|
84
85
|
- `overlay_only` when the gap is presentation, projection, or policy layering
|
|
85
86
|
over existing substrate rather than new execution capability.
|
|
86
87
|
- `attached_app` when the right home is an attached-app integration surface
|
|
87
|
-
rather than shared core substrate.
|
|
88
|
+
rather than shared core substrate (see `attached-app/SKILL.md`). Until the
|
|
89
|
+
runtime honors attachment metadata and health-gated activation, a needed
|
|
90
|
+
attach capability that cannot fully execute yet is itself a valid gap to
|
|
91
|
+
record.
|
|
88
92
|
- Prefer one concrete gap per missing shared capability.
|
|
89
93
|
- Use gap reports to tell MinuteWork where shared substrate may be missing. Do
|
|
90
94
|
not treat them as automatic implementation instructions.
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cross-server-subscriptions
|
|
3
|
+
description: "Reacting to changes in another server's published dataset: discovering dataset publications and declaring cross-server subscription candidates."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Cross-Server Subscriptions
|
|
7
|
+
|
|
8
|
+
Use this skill when the app should react to changes in another server's
|
|
9
|
+
published dataset -- for example keeping a local mirror of a partner's
|
|
10
|
+
registry, directory, or catalog feed in sync.
|
|
11
|
+
|
|
12
|
+
The etiquette is law:
|
|
13
|
+
**install proposes; only operators approve; nothing you build activates a cross-server subscription.**
|
|
14
|
+
Two distinct operator acts stand between your declaration and any delivery.
|
|
15
|
+
|
|
16
|
+
## Discover First
|
|
17
|
+
|
|
18
|
+
Before declaring a candidate, list what the tenant could actually subscribe
|
|
19
|
+
to. Both surfaces are read-only and can never create or activate anything:
|
|
20
|
+
|
|
21
|
+
- Workspace MCP tool: `minutework_discover_dataset_publications`.
|
|
22
|
+
- CLI: `minutework workspace discover-publications [--json]`.
|
|
23
|
+
|
|
24
|
+
Each result row describes one publication: `publication_ref` (the stable
|
|
25
|
+
reference to cite in your candidate reasoning), `event_family`,
|
|
26
|
+
`subject_key`, `event_types`, `residency_classification`, `publisher`
|
|
27
|
+
(`display_name`, `is_self`), and `registered_at`. Rows owned by your own
|
|
28
|
+
tenant additionally carry `status` and `descriptor_digest`.
|
|
29
|
+
|
|
30
|
+
- Discovery is flag-gated platform-side: when the feature is off the platform
|
|
31
|
+
returns HTTP 503 and the tools report an explicit empty list with
|
|
32
|
+
diagnostics, not a guess.
|
|
33
|
+
- HTTP 401 means the developer token is stale: run `minutework login` and
|
|
34
|
+
retry.
|
|
35
|
+
|
|
36
|
+
## Candidate Vocabulary
|
|
37
|
+
|
|
38
|
+
Declare interest with `crossServerSubscriptionCandidates` in
|
|
39
|
+
`schemas/schema.ts` (or `schema.mw`):
|
|
40
|
+
|
|
41
|
+
- `id`: workspace-authored candidate identifier (shares one id namespace with
|
|
42
|
+
`eventSubscriptions`).
|
|
43
|
+
- `eventPattern`: exact `<family>.<verb>` or trailing `<family>.*`. The v1
|
|
44
|
+
family is `dataset` with verbs `records_added` and `snapshot_refreshed`;
|
|
45
|
+
Core's registry, not the compiler, decides which families exist. Because
|
|
46
|
+
the compiler does not validate family names against that registry, a
|
|
47
|
+
candidate that compiles clean can still be rejected at report time as an
|
|
48
|
+
unknown family -- the rejection is receipted for operators and the local
|
|
49
|
+
declaration stays put; the fix is changing the pattern, whose new digest
|
|
50
|
+
reports afresh.
|
|
51
|
+
- `subjectKey`: the correlation key the candidate expects on delivered
|
|
52
|
+
events (match it to the publication's `subject_key`).
|
|
53
|
+
- `publisherHint` (optional): which publisher you expect, as a hint for the
|
|
54
|
+
reviewing operator.
|
|
55
|
+
- `reason` (required): shown verbatim to the reviewing operator. Write it for
|
|
56
|
+
a human: say what the flow does with the data and why the subscription is
|
|
57
|
+
needed, not compiler-speak.
|
|
58
|
+
- `targetFlow`: a flow declared in the same pack; it is what would wake if an
|
|
59
|
+
operator ever approves delivery.
|
|
60
|
+
|
|
61
|
+
Candidates and `eventSubscriptions` share one `(pattern, targetFlow)` pair
|
|
62
|
+
namespace in addition to the id namespace: each candidate compiles to its own
|
|
63
|
+
local subscription half, so declaring an explicit local subscription with the
|
|
64
|
+
same pair is a compile error
|
|
65
|
+
(`compiler.event_subscription.duplicate_pattern_target`). Candidate-implied
|
|
66
|
+
subscriptions carry no filters.
|
|
67
|
+
|
|
68
|
+
## What Install Does -- And Does Not Do
|
|
69
|
+
|
|
70
|
+
At install, each candidate:
|
|
71
|
+
|
|
72
|
+
- Wires its local half: the local subscription that would wake `targetFlow`
|
|
73
|
+
IF the cross-server side is ever operator-approved. The local row alone is
|
|
74
|
+
inert and harmless.
|
|
75
|
+
- Is declared runtime-locally with a declared/reported/withdrawn lifecycle
|
|
76
|
+
keyed by `candidate_digest`. Reinstalling a pack withdraws candidates whose
|
|
77
|
+
digests are absent from the new install.
|
|
78
|
+
- May later be reported upward to Core as a proposal -- that reporting sweep
|
|
79
|
+
is itself flag-gated (`MW_CROSS_SERVER_CANDIDATE_REPORTING_ENABLED`,
|
|
80
|
+
default off). The same sweep reports withdrawals, so a still-pending Core
|
|
81
|
+
proposal is withdrawn when its digest disappears from a reinstall.
|
|
82
|
+
|
|
83
|
+
Operators review reported proposals on the platform operator console. They
|
|
84
|
+
may dismiss a proposal, or promote it into a pending-approval subscription
|
|
85
|
+
that still requires a second digest-checked operator approval before anything
|
|
86
|
+
is active. Promotion scopes that subscription from an active, family-matched
|
|
87
|
+
publisher registration the operator picks -- your `subjectKey` and
|
|
88
|
+
`publisherHint` are advisory input to that choice, not binding scope. Either
|
|
89
|
+
operator decision is durable: re-reporting an unchanged digest is an
|
|
90
|
+
idempotent duplicate and never resurrects a dismissed, promoted, or withdrawn
|
|
91
|
+
proposal. The etiquette again:
|
|
92
|
+
**install proposes; only operators approve; nothing you build activates a cross-server subscription.**
|
|
93
|
+
|
|
94
|
+
Do not present an installed candidate as a working feed. Until both operator
|
|
95
|
+
acts happen, no cross-server event will ever arrive.
|
|
96
|
+
|
|
97
|
+
## Worked Example
|
|
98
|
+
|
|
99
|
+
A subscriber pack that mirrors a generic upstream registry publication: one
|
|
100
|
+
flow and one candidate. The candidate's implied local half is the pack's only
|
|
101
|
+
subscription -- do not also declare an explicit `eventSubscriptions` entry
|
|
102
|
+
with the same `(pattern, targetFlow)` pair; the candidate already implies
|
|
103
|
+
that local half, so the duplicate is a compile error.
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
flows: [
|
|
107
|
+
{
|
|
108
|
+
id: "registry.sync_entry",
|
|
109
|
+
description:
|
|
110
|
+
"Upsert one local mirror entry when upstream registry records change.",
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
crossServerSubscriptionCandidates: [
|
|
114
|
+
{
|
|
115
|
+
id: "registry.upstream_feed_candidate",
|
|
116
|
+
eventPattern: "dataset.records_added",
|
|
117
|
+
subjectKey: "entry_ref",
|
|
118
|
+
publisherHint: "partner-registry",
|
|
119
|
+
reason:
|
|
120
|
+
"Keep this tenant's local registry mirror current so member-facing " +
|
|
121
|
+
"lookups reflect the partner registry without manual re-imports.",
|
|
122
|
+
targetFlow: "registry.sync_entry",
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The flow body should be replay-safe (for example, upsert the mirror record
|
|
128
|
+
keyed on the event's opaque record ref) because wake delivery is
|
|
129
|
+
at-least-once with deterministic convergence.
|
|
130
|
+
|
|
131
|
+
## Staleness
|
|
132
|
+
|
|
133
|
+
If this guidance looks stale or the discovery tooling seems missing, refresh
|
|
134
|
+
managed workspace assets with `minutework workspace sync-assets` (see
|
|
135
|
+
`skills/workspace-guidance-refresh/SKILL.md`).
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dataset-subscriber-flow
|
|
3
|
+
description: "A tenant wants their app or agent to react when an external or reference dataset changes: discovery-first subscriber packs over published cross-server datasets."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Dataset Subscriber Flow
|
|
7
|
+
|
|
8
|
+
Use this skill when the tenant goal is "react when that external or reference
|
|
9
|
+
dataset changes" -- new records landing in a shared registry, a refreshed
|
|
10
|
+
directory snapshot, a catalog another server publishes. The answer is a
|
|
11
|
+
discovery-first, declarative subscriber pack -- never scraping, polling, or
|
|
12
|
+
replicating the upstream dataset.
|
|
13
|
+
|
|
14
|
+
Work the three steps in order. Do not skip discovery, and do not promise
|
|
15
|
+
activation: that is an operator decision, not a build output.
|
|
16
|
+
|
|
17
|
+
## Step 1 -- Discover
|
|
18
|
+
|
|
19
|
+
Find out what is actually published before designing anything.
|
|
20
|
+
|
|
21
|
+
- From a generated workspace, call the workspace MCP tool
|
|
22
|
+
`minutework_discover_dataset_publications`, or run:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
minutework workspace discover-publications
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
(add `--json` for machine-readable output). Both call the platform
|
|
29
|
+
discovery API with the workspace's tenant-bound developer token. Discovery
|
|
30
|
+
is read-only: listing a publication grants nothing and subscribes to
|
|
31
|
+
nothing.
|
|
32
|
+
- Interpret each result row:
|
|
33
|
+
- `publication_ref` -- the publication's stable opaque handle. Nothing
|
|
34
|
+
links a candidate to a `publication_ref` automatically, so echo the
|
|
35
|
+
matched publication's details into the candidate's `publisherHint` and
|
|
36
|
+
`reason` so the reviewing operator can find it.
|
|
37
|
+
- `event_family` and `event_types` -- what change signals exist. The v1
|
|
38
|
+
family is `dataset` with verbs `dataset.records_added` and
|
|
39
|
+
`dataset.snapshot_refreshed`.
|
|
40
|
+
- `subject_key` -- the correlation key delivered events will carry; your
|
|
41
|
+
candidate's `subjectKey` should match it.
|
|
42
|
+
- `residency_classification` -- how widely the publisher says the data may
|
|
43
|
+
travel; respect it when deciding what to mirror locally.
|
|
44
|
+
- `publisher` (`display_name`, `is_self`) -- who publishes it;
|
|
45
|
+
`is_self` means your own tenant.
|
|
46
|
+
- `registered_at`; own-tenant rows additionally show `status` and
|
|
47
|
+
`descriptor_digest`.
|
|
48
|
+
- Expected failure modes: a `503` means the platform discovery surface is
|
|
49
|
+
flag-gated off; a `401` means the developer token is missing or expired --
|
|
50
|
+
run `minutework login`.
|
|
51
|
+
- If nothing discoverable matches the tenant's dataset, **stop scaffolding**.
|
|
52
|
+
Do not improvise an ingestion path: no scraping the upstream surface, no
|
|
53
|
+
polling its APIs, no replicating its data into local records. Route to an
|
|
54
|
+
operator conversation instead -- record the missing publication as a
|
|
55
|
+
capability gap (see `skills/capability-gap-reporting/SKILL.md`) and let
|
|
56
|
+
humans decide whether the upstream side should publish.
|
|
57
|
+
|
|
58
|
+
## Step 2 -- Scaffold The Subscriber Pack
|
|
59
|
+
|
|
60
|
+
Build the subscriber declaratively in the workspace schema source
|
|
61
|
+
(`schemas/schema.ts` or `schema.mw`) using three vocabulary keys: `flows`
|
|
62
|
+
(compiled to `FlowManifestV1` documents) plus `eventSubscriptions` and
|
|
63
|
+
`crossServerSubscriptionCandidates` (compiled together into
|
|
64
|
+
`eventSubscriptionManifests` documents, `EventSubscriptionManifestV1`):
|
|
65
|
+
|
|
66
|
+
- `flows`: `[{ id, description?, definition? }]` -- the local flow the event
|
|
67
|
+
wakes.
|
|
68
|
+
- `eventSubscriptions`: `[{ id, eventTypePattern, targetFlow, filters? }]` --
|
|
69
|
+
local wiring for events that already reach this runtime (also valid on
|
|
70
|
+
connector packs). For cross-server dataset events you usually do not need
|
|
71
|
+
one: the candidate below implies it.
|
|
72
|
+
- `crossServerSubscriptionCandidates`:
|
|
73
|
+
`[{ id, eventPattern, subjectKey, publisherHint?, reason, targetFlow }]` --
|
|
74
|
+
the proposal that a human operator will review.
|
|
75
|
+
|
|
76
|
+
Generic worked sketch (a tenant whose app should react when a shared
|
|
77
|
+
directory server publishes new registry entries):
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
flows: [
|
|
81
|
+
{
|
|
82
|
+
id: "flow.registry_change_intake",
|
|
83
|
+
description: "Mirror new upstream registry entries into local records.",
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
crossServerSubscriptionCandidates: [
|
|
87
|
+
{
|
|
88
|
+
id: "cand.registry_records_added",
|
|
89
|
+
eventPattern: "dataset.records_added",
|
|
90
|
+
subjectKey: "registry_entry_id",
|
|
91
|
+
publisherHint: "shared-directory-server",
|
|
92
|
+
reason:
|
|
93
|
+
"Keep this tenant's local supplier catalog current by waking the " +
|
|
94
|
+
"registry intake flow when the upstream directory publishes new " +
|
|
95
|
+
"entries; without it the catalog goes stale between manual checks.",
|
|
96
|
+
targetFlow: "flow.registry_change_intake",
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
There is deliberately no plain `eventSubscriptions` entry in this sketch: the
|
|
102
|
+
candidate alone compiles the local subscription half that wakes
|
|
103
|
+
`flow.registry_change_intake`. The implied local half carries no `filters`,
|
|
104
|
+
so any narrowing (for example, reacting only to `supplier` entries) belongs
|
|
105
|
+
inside the woken flow.
|
|
106
|
+
|
|
107
|
+
Authoring rules the compiler enforces:
|
|
108
|
+
|
|
109
|
+
- Patterns are exact `<family>.<verb>` or a trailing `<family>.*` only; no
|
|
110
|
+
embedded `*`. The compiler does NOT validate family names against Core's
|
|
111
|
+
registry -- Core is the single source of truth for which families exist.
|
|
112
|
+
- Filter operators are the verbatim runtime vocabulary: `eq`, `neq`, `in`,
|
|
113
|
+
`not_in`, `gt`, `gte`, `lt`, `lte`, `contains`, `starts_with`. Filters AND
|
|
114
|
+
together.
|
|
115
|
+
- Duplicate `(pattern, targetFlow)` pairs and duplicate filters are compile
|
|
116
|
+
errors; `targetFlow` must name a flow in the same pack.
|
|
117
|
+
- Candidates count toward the `(pattern, targetFlow)` pairs -- each candidate
|
|
118
|
+
compiles its own local subscription half (with no filters) -- so do not
|
|
119
|
+
also declare a plain `eventSubscription` for the same pair.
|
|
120
|
+
- Write the candidate `reason` for the human operator who will review it: say
|
|
121
|
+
what the flow does with the events and why the tenant needs them. It is
|
|
122
|
+
shown verbatim to the reviewer; a vague reason earns a dismissal.
|
|
123
|
+
|
|
124
|
+
Keep the woken flow replay-safe (delivery is at-least-once): idempotent local
|
|
125
|
+
record upserts keyed on the event's record reference, and any effectful
|
|
126
|
+
follow-up the flow proposes parks in the existing human-approval loop rather
|
|
127
|
+
than executing directly.
|
|
128
|
+
|
|
129
|
+
## Step 3 -- Etiquette
|
|
130
|
+
|
|
131
|
+
**install proposes; only operators approve; nothing you build activates a cross-server subscription.**
|
|
132
|
+
|
|
133
|
+
State this plainly to the tenant. What install actually does:
|
|
134
|
+
|
|
135
|
+
- A candidate implies its local half: install wires the
|
|
136
|
+
`LocalEventSubscription` that will wake the flow IF the cross-server side
|
|
137
|
+
is ever operator-approved. The local row alone is inert and harmless --
|
|
138
|
+
firing additionally requires the pack to be `ACTIVE` and is globally gated
|
|
139
|
+
by the runtime flag `MW_LOCAL_EVENT_DISPATCH_ENABLED` (default off). A wake
|
|
140
|
+
is a deterministic flow-start job per (event, subscription).
|
|
141
|
+
- Subscriptions are replaced per pack at install; an invalid target flow
|
|
142
|
+
fails the whole install. Candidates are stored runtime-locally with a
|
|
143
|
+
declared/reported/withdrawn lifecycle keyed by `candidate_digest`;
|
|
144
|
+
reinstalling withdraws digests no longer declared (withdrawals are reported
|
|
145
|
+
upward too, withdrawing a still-pending Core proposal).
|
|
146
|
+
- Two operator acts stand between your candidate and a live subscription:
|
|
147
|
+
stored candidates are reported upward by a flag-gated runtime sweep
|
|
148
|
+
(`MW_CROSS_SERVER_CANDIDATE_REPORTING_ENABLED`, default off) to Core
|
|
149
|
+
proposals; operators review them on the platform operator console, where
|
|
150
|
+
promoting yields a pending-approval subscription that STILL requires a
|
|
151
|
+
second digest-checked operator approval (or they dismiss the proposal).
|
|
152
|
+
Either decision is durable: re-reporting an unchanged digest is an
|
|
153
|
+
idempotent duplicate and never resurrects a dismissed, promoted, or
|
|
154
|
+
withdrawn proposal -- a fresh proposal needs changed digest-covered content
|
|
155
|
+
(`eventPattern`, `subjectKey`, or `targetFlow`).
|
|
156
|
+
- Delivery also requires the publisher side to be active and approved. Even a
|
|
157
|
+
fully approved subscriber receives nothing until the publishing server's
|
|
158
|
+
side is live.
|
|
159
|
+
|
|
160
|
+
Never instruct or attempt any of the following: creating or activating a
|
|
161
|
+
cross-server subscription, calling operator review or posture APIs, or
|
|
162
|
+
presenting an installed candidate as a working integration. The honest status
|
|
163
|
+
after install is "proposed, awaiting operator review."
|
|
164
|
+
|
|
165
|
+
## Disqualifiers
|
|
166
|
+
|
|
167
|
+
- **Bulk data movement.** If the tenant wants dataset slices copied locally,
|
|
168
|
+
that is the explicit grant-scoped import/copy flow, not a subscription.
|
|
169
|
+
Subscriptions deliver change signals, not the dataset.
|
|
170
|
+
- **No discoverable publication.** Route to an operator conversation via the
|
|
171
|
+
capability-gap path (Step 1); never scrape, poll, or replicate.
|
|
172
|
+
- **Per-customer deliverables.** Outputs for each of the tenant's customers
|
|
173
|
+
should be runtime content/workflow outputs produced through the installed
|
|
174
|
+
pack, not a new pack per customer.
|
|
175
|
+
|
|
176
|
+
## Related Skills
|
|
177
|
+
|
|
178
|
+
- `skills/cross-server-subscriptions/SKILL.md` -- the full vocabulary and
|
|
179
|
+
lifecycle detail behind candidates, proposals, and approvals.
|
|
180
|
+
- `skills/event-bus/SKILL.md` -- runtime-local event wiring the woken flow
|
|
181
|
+
builds on.
|
|
182
|
+
- `skills/capability-gap-reporting/SKILL.md` -- recording the gap when no
|
|
183
|
+
publication exists.
|
|
184
|
+
- If this skill is missing from an older generated workspace, refresh managed
|
|
185
|
+
guidance with `minutework workspace sync-assets`
|
|
186
|
+
(see `skills/workspace-guidance-refresh/SKILL.md`).
|
|
@@ -11,3 +11,73 @@ Use runtime-local events for decoupled app behavior.
|
|
|
11
11
|
- Keep private payloads, traces, and detailed execution state runtime-local.
|
|
12
12
|
- Project only safe receipts or summaries outward when required.
|
|
13
13
|
- Use explicit filters and targets instead of broad catch-all handlers.
|
|
14
|
+
|
|
15
|
+
## Source Vocabulary
|
|
16
|
+
|
|
17
|
+
Declare event-driven behavior in `schemas/schema.ts` (or `schema.mw`):
|
|
18
|
+
|
|
19
|
+
- `flows`: `[{ id, description?, definition? }]` -- the runnable targets that
|
|
20
|
+
subscriptions wake.
|
|
21
|
+
- `eventSubscriptions`: `[{ id, eventTypePattern, targetFlow, filters? }]` --
|
|
22
|
+
local subscriptions. Also valid on connector packs.
|
|
23
|
+
|
|
24
|
+
Minimal example:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
flows: [
|
|
28
|
+
{
|
|
29
|
+
id: "registry.refresh_entry",
|
|
30
|
+
description: "Refresh one cached directory entry.",
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
eventSubscriptions: [
|
|
34
|
+
{
|
|
35
|
+
id: "registry.entry_updated_sub",
|
|
36
|
+
eventTypePattern: "directory.entry_updated",
|
|
37
|
+
targetFlow: "registry.refresh_entry",
|
|
38
|
+
filters: [
|
|
39
|
+
{ field_path: "payload.status", operator: "eq", value: "active" },
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Pattern Rules
|
|
46
|
+
|
|
47
|
+
- Patterns are exact `<family>.<verb>` or a trailing `<family>.*` wildcard
|
|
48
|
+
only. No embedded `*`, no bare `*`.
|
|
49
|
+
- The compiler does not validate family names against Core's registry; Core
|
|
50
|
+
is the single source of truth for which event families exist.
|
|
51
|
+
|
|
52
|
+
## Filters
|
|
53
|
+
|
|
54
|
+
- Operators (verbatim runtime vocabulary): `eq`, `neq`, `in`, `not_in`, `gt`,
|
|
55
|
+
`gte`, `lt`, `lte`, `contains`, `starts_with`.
|
|
56
|
+
- Multiple filters on one subscription AND together: an event must satisfy
|
|
57
|
+
every filter to wake the target flow.
|
|
58
|
+
- Duplicate `(pattern, targetFlow)` pairs and duplicate filters are compile
|
|
59
|
+
errors. `targetFlow` must name a flow declared in the same pack.
|
|
60
|
+
- Cross-server subscription candidates share the same id namespace and count
|
|
61
|
+
toward `(pattern, targetFlow)` uniqueness, because each candidate implies
|
|
62
|
+
its local subscription half (see
|
|
63
|
+
`skills/cross-server-subscriptions/SKILL.md`).
|
|
64
|
+
|
|
65
|
+
## Dispatch Behavior
|
|
66
|
+
|
|
67
|
+
- Subscriptions compile into the `eventSubscriptionManifests` document kind
|
|
68
|
+
and materialize as local subscription rows at install.
|
|
69
|
+
- Flow targets only in v1: a matching event starts the target flow through a
|
|
70
|
+
deterministic flow-start job per `(event, subscription)` pair, so replays
|
|
71
|
+
converge on one run instead of double-firing.
|
|
72
|
+
- Firing requires the owning pack to be ACTIVE and is globally gated by the
|
|
73
|
+
runtime flag `MW_LOCAL_EVENT_DISPATCH_ENABLED` (default off).
|
|
74
|
+
|
|
75
|
+
## Install Semantics
|
|
76
|
+
|
|
77
|
+
- Install replaces a pack's subscriptions wholesale (delete-and-recreate per
|
|
78
|
+
pack, mirroring sidecar registrations).
|
|
79
|
+
- An invalid target flow fails the whole install -- no partial wiring, no
|
|
80
|
+
partial activation.
|
|
81
|
+
|
|
82
|
+
For anything that crosses server boundaries (reacting to another server's
|
|
83
|
+
published dataset), read `skills/cross-server-subscriptions/SKILL.md`.
|
|
@@ -6,7 +6,9 @@ description: "Choosing between configuration, app-pack changes, overlays, attach
|
|
|
6
6
|
# Layering And Import Modes
|
|
7
7
|
|
|
8
8
|
Use this skill when choosing between configuration, app-pack changes, overlays,
|
|
9
|
-
`attached_app`, or OSS intake.
|
|
9
|
+
`attached_app`, or OSS intake. For a fresh product request, start at
|
|
10
|
+
`solution-router/SKILL.md`, which classifies the request and ranks reviewed
|
|
11
|
+
capability skills before this layering decision.
|
|
10
12
|
|
|
11
13
|
- Prefer the highest layer that solves the request:
|
|
12
14
|
- configure an existing capability, skill, or baseline substrate first
|
|
@@ -21,7 +23,10 @@ Use this skill when choosing between configuration, app-pack changes, overlays,
|
|
|
21
23
|
`integration-broker-and-connectors/SKILL.md` and use the broker substrate when
|
|
22
24
|
it fits.
|
|
23
25
|
- Use `attached_app` when a mature foreign system should remain its own
|
|
24
|
-
subsystem and MinuteWork should compile a governed control surface around it
|
|
26
|
+
subsystem and MinuteWork should compile a governed control surface around it;
|
|
27
|
+
see `attached-app/SKILL.md` for the authoring procedure and
|
|
28
|
+
`solution-router/SKILL.md` for choosing it over a connector, sidecar, or repo
|
|
29
|
+
intake.
|
|
25
30
|
- Use `external_repo_intake` only when no reviewed capability skill or cleaner
|
|
26
31
|
`attached_app` path fits. Any repo intake must stay inside the bounded Builder
|
|
27
32
|
sandbox.
|
|
@@ -31,12 +31,19 @@ needed:
|
|
|
31
31
|
belongs in governed runtime capabilities instead of browser/provider calls.
|
|
32
32
|
- `layering-and-import-modes/SKILL.md` for build-native vs govern-existing,
|
|
33
33
|
`attached_app`, OSS adoption, and greenfield-last decisions.
|
|
34
|
+
- `solution-router/SKILL.md` for routing a common product request to the right
|
|
35
|
+
reviewed capability skill and deployment mode before open-ended research.
|
|
36
|
+
- `attached-app/SKILL.md` for governing a mature foreign subsystem the tenant
|
|
37
|
+
hosts as an attached control surface, reads via Query and writes via Action.
|
|
34
38
|
- `integration-broker-and-connectors/SKILL.md` for external integrations, paid
|
|
35
39
|
acquisition, ads, brokered connectors, spend/approval governance, and
|
|
36
40
|
`mw.connector.ads`.
|
|
37
41
|
- `sidecar-generation/SKILL.md` for bridge/integration execution, workers,
|
|
38
42
|
webhooks, schedulers, and backend compute.
|
|
39
43
|
- `standalone-mobile-client/SKILL.md` for Expo/native client boundaries.
|
|
44
|
+
- `dataset-subscriber-flow/SKILL.md` for reacting to published cross-server
|
|
45
|
+
dataset changes: discovery-first subscriber packs, cross-server candidates,
|
|
46
|
+
and the operator-approval etiquette.
|
|
40
47
|
- `ontology-mapping/SKILL.md` for shared URNs, overlays, explicit promotion,
|
|
41
48
|
and the data network-effect story.
|
|
42
49
|
- `shadow-participation-and-guest-threads/SKILL.md` for guests, external
|