@paradigma-inc/flywheel 0.1.16 → 0.1.25

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.
Files changed (60) hide show
  1. package/README.md +8 -0
  2. package/package.json +1 -1
  3. package/skills/flywheel/SKILL.md +1 -0
  4. package/skills/flywheel/compute/managed-compute.md +111 -2
  5. package/skills/flywheel/references/experiment-design-protocol.md +1 -1
  6. package/skills/flywheel/references/flywheel-mcp-tool-map.md +130 -142
  7. package/skills/flywheel/setting-up-flywheel/updating-flywheel-mcp.md +8 -0
  8. package/skills/flywheel-auto/SKILL.md +14 -6
  9. package/skills/flywheel-auto/evals/evals.json +6 -0
  10. package/skills/flywheel-auto/references/ARTIFACTS.md +46 -216
  11. package/skills/flywheel-auto/references/INTERFACES.md +196 -195
  12. package/skills/flywheel-auto/references/experiment-design-protocol-autonomous.md +62 -0
  13. package/skills/flywheel-auto/references/experiment-design-protocol.md +1 -1
  14. package/skills/flywheel-auto/references/flywheel-mcp-tool-map.md +130 -142
  15. package/skills/flywheel-lookahead/SKILL.md +23 -15
  16. package/skills/flywheel-lookahead/agents/openai.yaml +3 -3
  17. package/skills/flywheel-lookahead/evals/evals.json +13 -1
  18. package/skills/flywheel-lookahead/references/ARTIFACTS.md +46 -216
  19. package/skills/flywheel-lookahead/references/INTERFACES.md +196 -195
  20. package/skills/flywheel-lookahead/references/flywheel-mcp-tool-map.md +130 -142
  21. package/skills/flywheel-prove/SKILL.md +163 -0
  22. package/skills/flywheel-prove/agents/interface.yaml +4 -0
  23. package/skills/flywheel-prove/assets/pipeline_template/bin/tproof +3 -0
  24. package/skills/flywheel-prove/assets/pipeline_template/bin/tproof.cmd +2 -0
  25. package/skills/flywheel-prove/assets/pipeline_template/logs/.gitkeep +1 -0
  26. package/skills/flywheel-prove/assets/pipeline_template/pyproject.toml +23 -0
  27. package/skills/flywheel-prove/assets/pipeline_template/scripts/smoke_test.cmd +2 -0
  28. package/skills/flywheel-prove/assets/pipeline_template/scripts/smoke_test.sh +3 -0
  29. package/skills/flywheel-prove/assets/pipeline_template/src/tproof/__init__.py +1 -0
  30. package/skills/flywheel-prove/assets/pipeline_template/src/tproof/cli.py +298 -0
  31. package/skills/flywheel-prove/assets/pipeline_template/src/tproof/constants.py +10 -0
  32. package/skills/flywheel-prove/assets/pipeline_template/src/tproof/layout.py +51 -0
  33. package/skills/flywheel-prove/assets/pipeline_template/src/tproof/leanops.py +116 -0
  34. package/skills/flywheel-prove/assets/pipeline_template/src/tproof/runstore.py +58 -0
  35. package/skills/flywheel-prove/assets/pipeline_template/src/tproof/tasking.py +94 -0
  36. package/skills/flywheel-prove/assets/pipeline_template/workspace/prompts/fill_sorries.txt +3 -0
  37. package/skills/flywheel-prove/references/workflow.md +193 -0
  38. package/skills/flywheel-prove/scripts/scaffold_pipeline.py +111 -0
  39. package/skills/flywheel-reproduce/SKILL.md +31 -23
  40. package/skills/flywheel-reproduce/evals/evals.json +7 -1
  41. package/skills/flywheel-reproduce/references/ARTIFACTS.md +46 -216
  42. package/skills/flywheel-reproduce/references/INTERFACES.md +196 -195
  43. package/skills/flywheel-reproduce/references/experiment-design-protocol.md +1 -1
  44. package/skills/flywheel-reproduce/references/flywheel-mcp-tool-map.md +130 -142
  45. package/skills/flywheel-reproduce/references/source-blog.md +35 -0
  46. package/skills/flywheel-reproduce/references/source-generic.md +30 -0
  47. package/skills/flywheel-reproduce/references/source-notes.md +35 -0
  48. package/skills/flywheel-reproduce/references/source-paper.md +89 -0
  49. package/skills/flywheel-reproduce/references/source-wiki.md +36 -0
  50. package/skills/flywheel-to-graph/SKILL.md +27 -21
  51. package/skills/flywheel-to-graph/evals/evals.json +7 -1
  52. package/skills/flywheel-to-graph/references/ARTIFACTS.md +46 -216
  53. package/skills/flywheel-to-graph/references/INTERFACES.md +196 -195
  54. package/skills/flywheel-to-graph/references/flywheel-mcp-tool-map.md +130 -142
  55. package/skills/flywheel-to-graph/references/source-blog.md +34 -0
  56. package/skills/flywheel-to-graph/references/source-generic.md +29 -0
  57. package/skills/flywheel-to-graph/references/source-notes.md +34 -0
  58. package/skills/flywheel-to-graph/references/source-paper.md +85 -0
  59. package/skills/flywheel-to-graph/references/source-wiki.md +35 -0
  60. package/src/cli.mjs +69 -3
@@ -1,160 +1,148 @@
1
1
  # Flywheel MCP Tool Map
2
2
 
3
- This reference describes the Flywheel MCP tool families and the common runtime
4
- contract expected by the public Flywheel skill.
3
+ Contract-aligned routing guide for Flywheel MCP tool usage.
5
4
 
6
- Use it as a routing guide, not as a session snapshot. Always verify the exact
7
- tool surface exposed by your current MCP host before executing critical flows.
5
+ Flywheel is a graph-based system for tracking research work, decisions, and evidence over time. Flywheel MCP is the tool interface for reading and updating that graph. You can discover, create, and manage nodes. You can collaborate with other users and use managed compute.
8
6
 
9
7
  ## Core Contract Expectations
10
8
 
11
- - Node lifecycle and graph-mutation flows use optimistic locking
12
- (`expected_revision`).
13
- - Node commits require `kind`, `outcome`, and `summary`.
14
- - `kind` is typically `insight` or `empirical`.
15
- - `insight` commits require non-empty `insights`.
16
- - `empirical` commits require a non-empty `hypothesis`; completed empirical
17
- commits also require artifacts or a `no_artifacts_reason`.
18
- - Artifact publish is a two-step flow:
19
- prepare upload, upload raw bytes to returned signed URLs, then finalize
20
- the upload batch.
9
+ - Use `flywheel_get_contract` + `flywheel_get_contract_section` as canonical contract references.
10
+ - Node state is canonical durable state; avoid relying on ephemeral transcript state.
11
+ - Node kind (`untyped`, `empirical`, `insight`) is an explicit durable field.
12
+ - Node references include immutable `node_id` and optional immutable `slug_name`; prefer communicating both together for human clarity and disambiguation.
13
+ - Insight nodes should represent conceptual observations (theoretical insights, intuitions, motivations, decision-relevant framing); empirical nodes should represent experiments with explicit hypotheses and measured outcomes.
14
+ - Graph topology should encode logical/causal relations between concepts and experiments. Avoid defaulting to shallow root-only branching unless work items are truly independent.
15
+ - For empirical work, publish evidence with `flywheel_prepare_artifact_uploads`, upload raw file bytes, then `flywheel_finalize_artifact_uploads` before commit.
16
+ - Artifact metadata records expose a non-empty `title` suitable for display labels; title normalization must never derive from `storage_url`.
21
17
 
22
18
  ## Tool Families
23
19
 
24
- ### Session, Auth, and Contract
25
-
26
- - `mcp__flywheel__flywheel_auth_status`
27
- - `mcp__flywheel__flywheel_get_contract`
28
- - `mcp__flywheel__flywheel_get_contract_section`
29
- - `mcp__flywheel__flywheel_get_credits_balance`
30
-
31
- ### Node Discovery and Read
32
-
33
- - `mcp__flywheel__flywheel_list_nodes`
34
- - `mcp__flywheel__flywheel_get_node`
35
- - `mcp__flywheel__flywheel_get_node_tree`
36
- - `mcp__flywheel__flywheel_get_node_ancestry`
37
- - `mcp__flywheel__flywheel_summarize_node_tree`
38
- - `mcp__flywheel__flywheel_get_campaign_snapshot`
39
- - `mcp__flywheel__flywheel_list_audit`
40
-
41
- ### Node Mutation, Branching, and Commit
42
-
43
- - `mcp__flywheel__flywheel_stage_node_create`
44
- - `mcp__flywheel__flywheel_stage_node_update`
45
- - `mcp__flywheel__flywheel_commit_node`
46
- - `mcp__flywheel__flywheel_branch_node`
47
- - `mcp__flywheel__flywheel_merge_nodes`
48
- - `mcp__flywheel__flywheel_add_parent`
49
- - `mcp__flywheel__flywheel_remove_parent`
50
- - `mcp__flywheel__flywheel_delete_node`
51
- - `mcp__flywheel__flywheel_bulk_delete_nodes`
52
-
53
- ### Access Policy and Collaboration
54
-
55
- - `mcp__flywheel__flywheel_get_node_sharing`
56
- - `mcp__flywheel__flywheel_set_sharing_for_node`
57
- - `mcp__flywheel__flywheel_set_sharing_for_nodes`
58
-
59
- ### Tags and Graph Annotation
60
-
61
- - `mcp__flywheel__flywheel_create_node_tag`
62
- - `mcp__flywheel__flywheel_update_node_tag`
63
- - `mcp__flywheel__flywheel_delete_node_tag`
64
- - `mcp__flywheel__flywheel_set_node_tag_assignments`
20
+ ### Discovery and sharing
21
+
22
+ - `flywheel_auth_status` (read; scopes: `read`; HTTP: `GET /auth/status`; core surface): Return Flywheel auth status for the current access token.
23
+ - `flywheel_get_credits_balance` (read; scopes: `read`; HTTP: `GET /credits`; core surface): Return current user credits balance and lifetime counters.
24
+ - `flywheel_updates_list` (read; scopes: `read`; HTTP: `GET /mcp/updates`; core surface): List in-app updates/announcements for the signed-in user.
25
+ - `flywheel_updates_hide` (mutating; scopes: `write`; HTTP: `POST /mcp/updates/{announcement_id}/hide`; core surface): Mark one update as hidden for the current user (Don't show again).
26
+ - `flywheel_updates_hide_all_active` (mutating; scopes: `write`; HTTP: `POST /mcp/updates/hide-all-active`; core surface): Hide all active updates for the current user (Don't show all active again).
27
+ - `flywheel_updates_unhide` (mutating; scopes: `write`; HTTP: `DELETE /mcp/updates/{announcement_id}/hide`; core surface): Restore one hidden update for the current user.
28
+ - `flywheel_list_nodes` (read; scopes: `read`; HTTP: `GET /mcp/nodes`; full-surface only): List nodes with optional owners/writers/visibility filters and projection control (`core`, `topology`, `full`).
29
+ - `flywheel_resolve_node_slug` (read; scopes: `read`; HTTP: `GET /mcp/nodes/resolve-by-slug`; core surface): Resolve a node by slug_name with explicit conflict handling (`unique`, `context_resolved`, `ambiguous`, `not_found`).
30
+ - `flywheel_get_node_sharing` (read; scopes: `read`; HTTP: `GET /mcp/nodes/{node_id}/sharing`; full-surface only): Get node sharing for one node (owner/collaborators/visibility).
31
+ - `flywheel_set_sharing_for_node` (mutating; scopes: `write`; HTTP: `PUT /mcp/nodes/{node_id}/sharing`; full-surface only): Set sharing for one owned node (collaborators/private-unlisted-public visibility).
32
+ - `flywheel_set_sharing_for_nodes` (mutating; scopes: `write`; HTTP: `POST /mcp/nodes/sharing/bulk`; full-surface only): Apply one sharing configuration across multiple owned nodes in bulk.
33
+ - `flywheel_get_node` (read; scopes: `read`; HTTP: `GET /mcp/nodes/{node_id}`; core surface): Get one node by node_id.
34
+ - `flywheel_create_node_tag` (mutating; scopes: `write`; HTTP: `POST /mcp/nodes/{root_node_id}/tags`; full-surface only): Create one graph tag from a root node.
35
+ - `flywheel_update_node_tag` (mutating; scopes: `write`; HTTP: `PATCH /mcp/nodes/{root_node_id}/tags/{tag_id}`; full-surface only): Update one graph tag from a root node.
36
+ - `flywheel_delete_node_tag` (mutating; scopes: `write`; HTTP: `DELETE /mcp/nodes/{root_node_id}/tags/{tag_id}`; full-surface only): Delete one graph tag from a root node.
37
+ - `flywheel_set_node_tag_assignments` (mutating; scopes: `write`; HTTP: `PUT /mcp/nodes/{node_id}/tags`; full-surface only): Set graph tag assignments for one node.
38
+ - `flywheel_get_node_tree` (read; scopes: `read`; HTTP: `GET /mcp/nodes/{node_id}/tree`; full-surface only): Get a root-aware bounded tree/DAG projection for an anchor node.
39
+ - `flywheel_get_node_ancestry` (read; scopes: `read`; HTTP: `GET /mcp/nodes/{node_id}/ancestry`; full-surface only): Get ordered ancestry metadata from an anchor node to root boundaries.
40
+ - `flywheel_get_campaign_snapshot` (read; scopes: `read`; HTTP: `GET /mcp/nodes/{node_id}/campaign/snapshot`; core surface): Read the current campaign snapshot for a node's root campaign, including configured views and derived records.
41
+ - `flywheel_list_audit` (read; scopes: `read`; HTTP: `GET /mcp/nodes/{node_id}/audit`; full-surface only): List node MCP audit events.
42
+
43
+ ### Node stage and commit
44
+
45
+ - `flywheel_commit_new_node` (mutating; scopes: `write`; HTTP: `POST /mcp/nodes/commit-new`; full-surface only): Commit a locally staged new node into canonical storage and return the persisted node.
46
+ - `flywheel_acquire_stage_lease` (mutating; scopes: `write`; HTTP: `POST /mcp/nodes/{node_id}/stage/lease/acquire`; full-surface only): Acquire a session-scoped stage lease for an existing node before local staged edits.
47
+ - `flywheel_heartbeat_stage_lease` (mutating; scopes: `write`; HTTP: `POST /mcp/nodes/{node_id}/stage/lease/heartbeat`; full-surface only): Refresh the active stage lease for the current editing session.
48
+ - `flywheel_release_stage_lease` (mutating; scopes: `write`; HTTP: `POST /mcp/nodes/{node_id}/stage/lease/release`; full-surface only): Release the active stage lease for the current editing session.
49
+ - `flywheel_commit_node` (mutating; scopes: `write`; HTTP: `POST /mcp/nodes/{node_id}/commit`; core surface): Commit an existing node by publishing the caller's staged payload under an active stage lease.
50
+ - `flywheel_branch_node` (mutating; scopes: `write`; HTTP: `POST /mcp/nodes/{node_id}/branch`; full-surface only): Create a child branch node.
51
+ - `flywheel_merge_nodes` (mutating; scopes: `write`; HTTP: `POST /mcp/nodes/merge`; full-surface only): Merge nodes with caller-resolved node payload.
52
+ - `flywheel_add_parent` (mutating; scopes: `write`; HTTP: `POST /mcp/nodes/{node_id}/parents/add`; full-surface only): Attach an additional parent edge to an existing node (keeps node identity, validates against cycles).
53
+ - `flywheel_remove_parent` (mutating; scopes: `write`; HTTP: `POST /mcp/nodes/{node_id}/parents/remove`; full-surface only): Detach one parent edge from a node without deleting the node.
54
+ - `flywheel_delete_node` (mutating; scopes: `write`; HTTP: `DELETE /mcp/nodes/{node_id}`; full-surface only): Delete a node subtree.
55
+ - `flywheel_bulk_delete_nodes` (mutating; scopes: `write`; HTTP: `POST /mcp/nodes/bulk-delete`; full-surface only): Delete multiple node subtrees in one operation.
65
56
 
66
57
  ### Artifacts
67
58
 
68
- - `mcp__flywheel__flywheel_list_artifacts`
69
- - `mcp__flywheel__flywheel_get_artifact`
70
- - `mcp__flywheel__flywheel_get_artifact_preview`
71
- - `mcp__flywheel__flywheel_prepare_artifact_uploads`
72
- - `mcp__flywheel__flywheel_finalize_artifact_uploads`
73
- - `mcp__flywheel__flywheel_set_artifact_note`
74
- - `mcp__flywheel__flywheel_delete_artifact`
75
-
76
- Common artifact types include:
77
- `text`, `table`, `json`, `image`, `banner`, `html`, `plotly_html`, `vega`,
78
- `checkpoint`, and `diff_carousel`.
79
-
80
- ### Export and Import
81
-
82
- - `mcp__flywheel__flywheel_export_subgraph`
83
- - `mcp__flywheel__flywheel_import_subgraph`
84
- - `mcp__flywheel__flywheel_export_summary`
85
- - `mcp__flywheel__flywheel_export_summary_stream`
86
- - `mcp__flywheel__flywheel_export_summary_pdf`
87
- - `mcp__flywheel__flywheel_export_summary_render_pdf`
59
+ - `flywheel_prepare_artifact_uploads` (mutating; scopes: `write`; HTTP: `POST /mcp/nodes/{node_id}/artifacts/uploads/prepare`; core surface): Prepare one or more raw-file artifact uploads (returns batch token + signed upload URLs). Upload must send raw file bytes to the returned URLs (do not upload JSON metadata wrappers).
60
+ - `flywheel_finalize_artifact_uploads` (mutating; scopes: `write`; HTTP: `POST /mcp/nodes/{node_id}/artifacts/uploads/finalize`; core surface): Finalize a prepared artifact upload batch and append all staged artifacts to the node in one revision bump.
61
+ - `flywheel_list_artifacts` (read; scopes: `read`; HTTP: `GET /mcp/nodes/{node_id}/artifacts`; core surface): List node artifacts.
62
+ - `flywheel_get_artifact` (read; scopes: `read`; HTTP: `GET /mcp/nodes/{node_id}/artifacts/{artifact_id}`; core surface): Get one artifact by id.
63
+ - `flywheel_delete_artifact` (mutating; scopes: `write`; HTTP: `DELETE /mcp/nodes/{node_id}/artifacts/{artifact_id}`; core surface): Delete one artifact by id with optimistic locking.
64
+ - `flywheel_set_artifact_note` (mutating; scopes: `write`; HTTP: `PATCH /mcp/nodes/{node_id}/artifacts/{artifact_id}/note`; core surface): Set or clear one artifact note with optimistic locking.
88
65
 
89
66
  ### Executions
90
67
 
91
- - `mcp__flywheel__flywheel_launch_execution`
92
- - `mcp__flywheel__flywheel_list_executions`
93
- - `mcp__flywheel__flywheel_terminate_execution`
94
-
95
- ### Managed Compute
96
-
97
- - `mcp__flywheel__flywheel_approval_session_heartbeat`
98
- - `mcp__flywheel__flywheel_list_approval_sessions`
99
- - `mcp__flywheel__flywheel_expire_approval_session`
100
- - `mcp__flywheel__flywheel_request_compute_grant_approval`
101
- - `mcp__flywheel__flywheel_list_compute_grants`
102
- - `mcp__flywheel__flywheel_compute_list_options`
103
- - `mcp__flywheel__flywheel_compute_acquire`
104
- - `mcp__flywheel__flywheel_compute_status`
105
- - `mcp__flywheel__flywheel_compute_connection`
106
- - `mcp__flywheel__flywheel_compute_release`
107
- - `mcp__flywheel__flywheel_compute_release_all`
108
-
109
- ### Campaign Budgets (Organizer Flows)
110
-
111
- - `mcp__flywheel__flywheel_list_campaign_budgets`
112
- - `mcp__flywheel__flywheel_create_campaign_budget`
113
- - `mcp__flywheel__flywheel_update_campaign_budget`
114
- - `mcp__flywheel__flywheel_revoke_campaign_budget`
115
-
116
- ### Migration Helpers
117
-
118
- Some installations may expose migration-only helper tools with hashed names.
119
- Treat these as specialized one-off tools, not part of day-to-day research
120
- workflows.
68
+ - `flywheel_launch_execution` (mutating; scopes: `write`; HTTP: `POST /mcp/nodes/{node_id}/executions`; core surface): Launch node execution.
69
+ - `flywheel_list_executions` (read; scopes: `read`; HTTP: `GET /mcp/nodes/{node_id}/executions`; core surface): List node executions.
70
+ - `flywheel_terminate_execution` (mutating; scopes: `write`; HTTP: `POST /mcp/nodes/{node_id}/executions/{execution_id}/terminate`; core surface): Terminate a node execution.
71
+
72
+ ### Compute and budgets
73
+
74
+ - `flywheel_compute_list_options` (read; scopes: `compute`; HTTP: `GET /mcp/nodes/{node_id}/compute/options`; core surface): List managed compute options allowed for a node. When using grant-backed compute, pass the same compute_grant_id you will use for acquire.
75
+ - `flywheel_compute_status` (read; scopes: `compute`; HTTP: `GET /mcp/compute/status`; core surface): Read managed compute lease status for the current user and current lease_control_token scope. Lease rows include ownership flags so hosts can distinguish user-owned leases from sponsor-visible campaign leases. When checking a grant-backed lease, reuse the same compute_grant_id passed to acquire.
76
+ - `flywheel_compute_connection` (read; scopes: `compute`; HTTP: `GET /mcp/compute/connection`; core surface): Read SSH connection material for an active managed compute lease once flywheel_compute_status indicates the lease is usable. This tool is token-scoped to lease_control_token and only leases owned by the current user are connectable. Pass lease_id or node_id to disambiguate when needed.
77
+ - `flywheel_approval_session_heartbeat` (read; scopes: `compute`; HTTP: `POST /mcp/approval-sessions/heartbeat`; core surface): Create or refresh a compute-grant approval session for the current MCP host session.
78
+ - `flywheel_list_approval_sessions` (read; scopes: `compute`; HTTP: `GET /mcp/approval-sessions`; core surface): List approval sessions visible to the current user.
79
+ - `flywheel_expire_approval_session` (mutating; scopes: `compute`; HTTP: `POST /mcp/approval-sessions/expire`; core surface): Expire the current compute-grant approval session context without releasing active leases.
80
+ - `flywheel_request_compute_grant_approval` (mutating; scopes: `compute`; HTTP: `tool-mediated`; core surface): Request budget approval context before managed compute acquisition; branch on response status.
81
+ - `flywheel_list_compute_grants` (read; scopes: `compute`; HTTP: `GET /mcp/compute/grants`; core surface): List active/exhausted compute grants available to the current user.
82
+ - `flywheel_list_campaign_budgets` (read; scopes: `compute`; HTTP: `GET /mcp/nodes/{root_node_id}/campaign-budgets`; full-surface only): List campaign compute budgets for a campaign root. Organizer-only management view.
83
+ - `flywheel_create_campaign_budget` (mutating; scopes: `compute`; HTTP: `POST /mcp/nodes/{root_node_id}/campaign-budgets`; full-surface only): Create an organizer-funded campaign compute budget shared with participants.
84
+ - `flywheel_update_campaign_budget` (mutating; scopes: `compute`; HTTP: `PATCH /mcp/nodes/{root_node_id}/campaign-budgets/{compute_budget_id}`; full-surface only): Update hard caps or metadata for an organizer-funded campaign compute budget.
85
+ - `flywheel_revoke_campaign_budget` (mutating; scopes: `compute`; HTTP: `DELETE /mcp/nodes/{root_node_id}/campaign-budgets/{compute_budget_id}`; full-surface only): Revoke an organizer-funded campaign compute budget.
86
+ - `flywheel_compute_acquire` (mutating; scopes: `compute`; HTTP: `tool-mediated`; core surface): Acquire managed compute for a node with explicit SKU + region and required compute_grant_id (returns accepted/completed lease state only; poll flywheel_compute_status for readiness, not SSH key material). This tool forwards approval_session_id.
87
+ - `flywheel_compute_release` (mutating; scopes: `compute`; HTTP: `POST /mcp/compute/release`; core surface): Asynchronously release one managed compute lease by lease_id within the current lease_control_token scope.
88
+ - `flywheel_compute_release_all` (mutating; scopes: `compute`; HTTP: `POST /mcp/compute/release-all`; core surface): Asynchronously release active managed compute leases in the current lease_control_token scope; set force=true for explicit account-wide cleanup for the current user.
89
+
90
+ ### Contract, audit, and export
91
+
92
+ - `flywheel_get_contract` (read; scopes: `read`; HTTP: `GET /mcp/contract`; core surface): Return Flywheel MCP contract overview (scopes, write safety, operation catalog, and section index).
93
+ - `flywheel_get_contract_section` (read; scopes: `read`; HTTP: `GET /mcp/contract/sections/{section_id}`; core surface): Return one contract section by section_id (for example `graph` or `campaign/template_v1`).
94
+ - `flywheel_export_subgraph` (read; scopes: `read`; HTTP: `POST /mcp/export`; full-surface only): Export selected graph/subgraph nodes as JSON.
95
+ - `flywheel_import_subgraph` (mutating; scopes: `write`; HTTP: `POST /mcp/import`; full-surface only): Import graph/subgraph JSON payload into new node IDs. Set normalize_cycles=true to drop cycle/self-loop edges; default rejects cyclic payloads.
96
+ - `flywheel_summarize_node_tree` (read; scopes: `read`; HTTP: `GET /mcp/nodes/{node_id}/summary`; full-surface only): Summarize a node tree using node fields only.
97
+ - `flywheel_export_summary` (read; scopes: `read`; HTTP: `POST /mcp/export-summary`; full-surface only): Generate markdown summary for selected nodes.
98
+ - `flywheel_export_summary_stream` (read; scopes: `read`; HTTP: `POST /mcp/export-summary-stream`; full-surface only): Generate summary stream events for selected nodes.
99
+ - `flywheel_export_summary_pdf` (read; scopes: `read`; HTTP: `POST /mcp/export-summary-pdf`; full-surface only): Generate PDF summary for selected nodes.
100
+ - `flywheel_export_summary_render_pdf` (read; scopes: `read`; HTTP: `POST /mcp/export-summary-render-pdf`; full-surface only): Render provided markdown to PDF and embed export metadata.
121
101
 
122
102
  ## Practical Tool Sequences
123
103
 
124
- ### Insight Node Flow
125
-
126
- 1. `mcp__flywheel__flywheel_stage_node_create`
127
- 2. `mcp__flywheel__flywheel_stage_node_update`
128
- 3. `mcp__flywheel__flywheel_commit_node`
129
-
130
- ### Empirical Node With Artifacts
131
-
132
- 1. `mcp__flywheel__flywheel_stage_node_create`
133
- 2. `mcp__flywheel__flywheel_stage_node_update`
134
- 3. Run experiment or compute steps
135
- 4. `mcp__flywheel__flywheel_prepare_artifact_uploads`
136
- 5. Upload artifact bytes to signed URLs
137
- 6. `mcp__flywheel__flywheel_finalize_artifact_uploads`
138
- 7. `mcp__flywheel__flywheel_commit_node`
139
-
140
- ### Managed Compute Flow
141
-
142
- 1. `mcp__flywheel__flywheel_approval_session_heartbeat`
143
- 2. `mcp__flywheel__flywheel_request_compute_grant_approval`
144
- 3. `mcp__flywheel__flywheel_list_compute_grants` (if needed)
145
- 4. `mcp__flywheel__flywheel_compute_acquire`
146
- 5. `mcp__flywheel__flywheel_compute_status` until ready
147
- 6. `mcp__flywheel__flywheel_compute_connection`
148
- 7. `mcp__flywheel__flywheel_compute_release` (or `..._release_all`)
149
-
150
- ### Share a Graph With Collaborators
151
-
152
- 1. `mcp__flywheel__flywheel_get_node_sharing`
153
- 2. `mcp__flywheel__flywheel_set_sharing_for_node` (or `..._for_nodes`)
154
- 3. `mcp__flywheel__flywheel_export_summary` or `..._export_subgraph` for handoff
155
-
156
- ## Safety Notes
157
-
158
- - Prefer `get_contract` before implementing strict assumptions in automation.
159
- - Avoid call-order assumptions not mandated by contract.
160
- - Keep checks bounded: list/read first, then mutate only the intended nodes.
104
+ ### List Owned Nodes
105
+
106
+ 1. `flywheel_list_nodes` with `{'owners': ['me'], 'projection': 'core'}`.
107
+
108
+ ### Safe Node Update
109
+
110
+ 1. `flywheel_get_node`: Read latest node state before mutating fields.
111
+ 2. `flywheel_acquire_stage_lease`: Acquire a session-scoped stage lease before editing an existing node locally.
112
+ 3. `flywheel_commit_node`: Commit with `stage_session_id`, `base_committed_revision`, and full `staged_payload` once terminal and contract-complete.
113
+
114
+ ### Empirical Workflow
115
+
116
+ 1. `flywheel_commit_new_node`: Commit a local staged new node to canonical storage as the first persistence boundary.
117
+ 2. `flywheel_commit_node`: Commit staged empirical fields with `stage_session_id`, `base_committed_revision`, and a full `staged_payload` once the working state is ready to publish.
118
+ 3. `flywheel_request_compute_grant_approval`: If compute is needed, request budget approval context first. Branch on response status.
119
+ 4. Branch on `flywheel_request_compute_grant_approval.status`: Branch by response status (`already_approved`, `approval_required`, `insufficient_credits`).. if `already_approved` then `reuse_compute_grant_id`: Use returned `compute_grant_id` directly for flywheel_compute_acquire.. if `approval_required` then `present_approval_url_to_user`: Present `approval_url` to the user; the user opens it and confirms budget approval.; `flywheel_list_compute_grants`: After approval, list active grants for the current `approval_session_id` and use the returned `compute_grant_id` for acquire.. if `insufficient_credits` then `request_user_credit_top_up`: No `approval_url` is returned. Ask the user to add credits, then retry flywheel_request_compute_grant_approval.
120
+ 5. `flywheel_compute_acquire`: Acquire lease with `compute_grant_id`; include `approval_session_id` from approval response.
121
+ 6. `flywheel_compute_status`: Poll until the active lease is ready; follow `recommended_next_action`.
122
+ 7. `flywheel_launch_execution`: Launch execution once compute and inputs are ready.
123
+ 8. `flywheel_list_executions`: Poll until execution reaches terminal status.
124
+ 9. `flywheel_prepare_artifact_uploads`: Prepare signed upload URLs for empirical evidence.
125
+ 10. `raw_file_upload`: Upload raw bytes to each signed URL with required headers.
126
+ 11. `flywheel_finalize_artifact_uploads`: Finalize prepared uploads before commit, or set `no_artifacts_reason` when intentionally artifact-free.
127
+ 12. `flywheel_commit_node`: Commit terminal empirical node once contract requirements are satisfied.
128
+
129
+ ## Runtime Guidance
130
+
131
+ - `flywheel_resolve_node_slug`: resolve human-facing slug references. If response status is `ambiguous`, ask the user to confirm the intended node_id before mutating anything.
132
+ - `flywheel_get_node`: read the current node state before writes.
133
+ - `flywheel_acquire_stage_lease`, `flywheel_heartbeat_stage_lease`, `flywheel_release_stage_lease`: coordinate session-scoped local staged edits for an existing node before commit.
134
+ - `flywheel_get_campaign_snapshot`: read the current derived campaign state for this node's root campaign instead of inferring standings from freeform text.
135
+ - `flywheel_get_node_sharing`: after sharing writes, verify with flywheel_get_node_sharing before reporting private/shared/public state.
136
+ - `flywheel_compute_status`: check first when work may need managed compute (GPU), using the active lease_control_token from host context (or pass it explicitly).
137
+ - `flywheel_list_compute_grants`: list active compute grants (funded by user/root budgets) and select one `compute_grant_id` for acquisition.
138
+ - `flywheel_request_compute_grant_approval`: request/confirm budget before acquire and choose a budget source (`user` or `root`); branch on status (`already_approved`, `approval_required`, `insufficient_credits`).
139
+ - `flywheel_compute_connection`: read SSH connection material for the active user lease once status indicates the lease is usable, scoped by lease_control_token.
140
+ - `flywheel_compute_list_options`: use when a lease is needed and no suitable active lease exists, then select explicit provider-qualified `offer_id` (`provider::offer_id`) and `region`. Consider each option's `availability_mode`: `live_capacity` means provider-reported capacity, `allocation_time` means capacity is confirmed only when `flywheel_compute_acquire` attempts provisioning.
141
+ - `flywheel_compute_acquire`: provision compute once requirements are clear. This requires a valid `compute_grant_id` and returns lease/provisioning state only (not SSH key material). Capture `compute.lease_control_token` from the response for follow-up lease control tools.
142
+ - `flywheel_compute_release`: release compute when no longer needed, scoped by lease_control_token.
143
+ - `flywheel_launch_execution`, `flywheel_list_executions`, `flywheel_terminate_execution`: manage execution status transitions.
144
+ - `flywheel_prepare_artifact_uploads`: prepare one or more signed raw-file upload requests for concrete deliverables/evidence produced by the work.
145
+ - `flywheel_finalize_artifact_uploads`: finalize a staged artifact batch and append all uploaded artifacts in one revision bump.
146
+ - `flywheel_delete_artifact`: remove an accidental/obsolete node artifact.
147
+ - `flywheel_list_artifacts`, `flywheel_get_artifact`: inspect node artifact metadata (`title` is the display label) and consume `storage_url` for raw artifact bytes only.
148
+ - `flywheel_commit_new_node`, `flywheel_commit_node`: publish the caller's full staged payload for an existing node once terminal and contract-complete; requires an active stage lease and explicit `base_committed_revision`.
@@ -0,0 +1,35 @@
1
+ # Blog Source Reference
2
+
3
+ Use this reference for blog posts and article-style URLs.
4
+
5
+ ## Source Detection
6
+
7
+ Match this reference for sources from common blog/article domains or article-like HTML pages.
8
+
9
+ ## Acquisition
10
+
11
+ - Fetch URL content.
12
+ - Extract main article body and heading structure.
13
+
14
+ ## Decomposition
15
+
16
+ - Short posts: one node is acceptable.
17
+ - Long posts: parent article node plus section children by top-level headings.
18
+ - Complete source decomposition before branch planning.
19
+
20
+ ## Content and Artifacts
21
+
22
+ - Article narrative in node `content`.
23
+ - Summary in `summary`.
24
+ - Supporting media files as artifacts when available.
25
+
26
+ ## Edges
27
+
28
+ - Use hierarchy edges when section children are created.
29
+ - Avoid lateral interpretive edges by default.
30
+
31
+ ## Failure Behavior
32
+
33
+ - If fetch or extraction fails, emit explicit failure and stop.
34
+
35
+ These rules apply only when `$flywheel-reproduce` is the active skill.
@@ -0,0 +1,30 @@
1
+ # Generic Source Reference
2
+
3
+ Use this fallback when source type cannot be confidently matched to paper, wiki, blog, or notes.
4
+
5
+ ## Fallback Trigger
6
+
7
+ Activate this reference only after deterministic and natural-language routing fail to produce a confident match.
8
+
9
+ ## Acquisition
10
+
11
+ - Ask once for missing source location when not recoverable.
12
+ - Perform best-effort extraction from the provided source.
13
+
14
+ ## Decomposition
15
+
16
+ - If top-level headings are available, create parent and section children.
17
+ - If no structural cues are available, create one node with explicit summary of limitations.
18
+ - Complete source decomposition before any validation branch planning.
19
+
20
+ ## Content and Artifacts
21
+
22
+ - Keep extracted narrative in `content`.
23
+ - Attach supporting files as artifacts.
24
+
25
+ ## Failure Behavior
26
+
27
+ - If extraction fails, emit explicit failure and stop.
28
+ - Do not silently produce an underspecified graph.
29
+
30
+ These rules apply only when `$flywheel-reproduce` is the active skill.
@@ -0,0 +1,35 @@
1
+ # Notes Source Reference
2
+
3
+ Use this reference for local note directories such as Obsidian vaults, Logseq exports, or plain markdown note trees.
4
+
5
+ ## Source Detection
6
+
7
+ Match this reference when source is a local notes corpus with many small markdown files.
8
+
9
+ ## Acquisition
10
+
11
+ - Enumerate note files in requested scope.
12
+ - Preserve folder and filename context.
13
+
14
+ ## Decomposition
15
+
16
+ - Default: one note file -> one node.
17
+ - Large note files: split by top-level headings when useful.
18
+ - Complete decomposition before creating validation branches.
19
+
20
+ ## Content and Artifacts
21
+
22
+ - Note text in `content`.
23
+ - Concise note synopsis in `summary`.
24
+ - Embedded local files become artifacts when relevant.
25
+
26
+ ## Edges
27
+
28
+ - Add edges only for durable relationships (hierarchy, prerequisite, dependency).
29
+ - Keep casual backlinks inside markdown.
30
+
31
+ ## Failure Behavior
32
+
33
+ - If note files cannot be read, emit explicit failure with affected paths.
34
+
35
+ These rules apply only when `$flywheel-reproduce` is the active skill.
@@ -0,0 +1,89 @@
1
+ # Paper Source Reference
2
+
3
+ Use this reference when the source is a paper PDF, arXiv page, DOI URL, or direct PDF URL.
4
+
5
+ ## Source Detection
6
+
7
+ Match this reference when any of these are true:
8
+
9
+ - Local file ends with `.pdf`.
10
+ - URL matches `arxiv.org/abs/`.
11
+ - URL matches `arxiv.org/pdf/`.
12
+ - URL is a DOI resolver link (`doi.org/...`).
13
+ - URL is a direct PDF link.
14
+
15
+ ## Acquisition Rules
16
+
17
+ Acquire source content in this order:
18
+
19
+ 1. Local PDF path: read local file bytes and preserve original filename.
20
+ 2. arXiv HTML URL (`arxiv.org/abs/...` or `arxiv.org/html/...`): fetch page body and parse section structure from HTML.
21
+ 3. arXiv PDF URL (`arxiv.org/pdf/...`): download PDF bytes and treat as PDF input.
22
+ 4. DOI URL: resolve final landing page; if it exposes a PDF, download it, otherwise fetch the HTML body.
23
+ 5. Direct PDF URL: download PDF bytes.
24
+
25
+ ## Parsing Rules
26
+
27
+ For PDF text extraction, use parser fallback chain exactly:
28
+
29
+ `PyMuPDF -> pypdfium2 -> pypdf`
30
+
31
+ - Try one parser at a time in that order.
32
+ - Advance to the next parser only when the previous parser fails to extract usable text.
33
+ - If all parsers fail, emit explicit failure and stop. Do not continue with partial guessed structure.
34
+ - If all parsers fail, do not silently produce a single-summary node with a PDF artifact.
35
+
36
+ License note:
37
+
38
+ - PyMuPDF is AGPL-3.0. Artifex offers a commercial license when AGPL terms are not acceptable for downstream distribution.
39
+
40
+ For arXiv HTML parsing, use LaTeXML selector boundaries:
41
+
42
+ - Top-level sections: `section.ltx_section`
43
+ - Top-level headings: `h2.ltx_title`
44
+ - Subsections: `section.ltx_subsection`
45
+ - Subsection headings: `h3.ltx_title`
46
+
47
+ Do not use naive `section` selectors without class filtering.
48
+
49
+ ## Graph Decomposition Contract
50
+
51
+ Default shape:
52
+
53
+ - Create one parent paper node under the requested root.
54
+ - Create one child node per detected top-level paper section.
55
+ - Typical section set includes Abstract, Introduction, Methods, Results, Discussion, Conclusion, and Related Work when present.
56
+
57
+ ## Content Placement Contract
58
+
59
+ - Parent title: paper title.
60
+ - Parent summary: abstract or concise abstract-derived synopsis.
61
+ - Parent content: one-paragraph orientation plus links/references to section children.
62
+ - Child content: narrative for that section only.
63
+
64
+ ## Artifact Contract
65
+
66
+ - Attach the paper PDF artifact to the parent paper node.
67
+ - Attach extracted figures/tables to the section child where they appear, when extraction is feasible.
68
+
69
+ ## Edge Contract
70
+
71
+ - Use hierarchy edges for paper parent -> section children.
72
+ - Do not add lateral interpretive edges (`cites`, `builds-on`, `derived-from`) by default.
73
+
74
+ ## Insight Controller Contract
75
+
76
+ - Single-paper one-shot import: no separate insight control node is created.
77
+ - Multi-paper corpus import: create one insight control node above paper parent nodes.
78
+
79
+ ## Failure Contract
80
+
81
+ - If acquisition fails, return explicit failure with the failing source variant and stop.
82
+ - If all parsers fail, return explicit failure and stop.
83
+ - Do not silently degrade to one summary node plus artifact-only output.
84
+
85
+ ## Reproduce Ordering Contract
86
+
87
+ Finish paper decomposition before validation branch planning. Do not start step-8 branch execution planning until source decomposition is complete.
88
+
89
+ These rules apply only when `$flywheel-reproduce` is the active skill.
@@ -0,0 +1,36 @@
1
+ # Wiki Source Reference
2
+
3
+ Use this reference for markdown wiki-style corpora, README trees, GitHub wiki exports, and Notion markdown exports.
4
+
5
+ ## Source Detection
6
+
7
+ Match this reference when source material is wiki-like markdown content with multiple linked pages.
8
+
9
+ ## Acquisition
10
+
11
+ - Collect all relevant markdown pages in scope.
12
+ - Preserve stable page identifiers from file paths or page titles.
13
+
14
+ ## Decomposition
15
+
16
+ - One stable page or concept maps to one node by default.
17
+ - Large pages may split by top-level headings when that improves readability.
18
+ - Complete graphification before branch planning and execution.
19
+
20
+ ## Content and Artifacts
21
+
22
+ - Main narrative goes into node `content`.
23
+ - Short synopsis goes into `summary`.
24
+ - Supporting files (images, PDFs, data files, notebooks) are node artifacts.
25
+
26
+ ## Edges
27
+
28
+ - Promote only durable semantic relationships to graph edges.
29
+ - Keep incidental hyperlinks in markdown body.
30
+
31
+ ## Failure Behavior
32
+
33
+ - If pages are unreadable or missing, emit explicit failure and stop for that page.
34
+ - Do not silently skip unreadable pages.
35
+
36
+ These rules apply only when `$flywheel-reproduce` is the active skill.
@@ -44,9 +44,10 @@ Before authoring, recover or establish these inputs:
44
44
  1. Resolve the starting context.
45
45
  - Start from the provided source material or explicit source nodes.
46
46
  - Resolve governing nodes in this order: explicit node ids/slugs, explicitly named current context, focused or recently referenced nodes, then ask the user if nothing stable is recoverable.
47
- 2. Classify the input.
47
+ 2. Classify the input through source-type routing.
48
48
  - If it is already a normalized Flywheel graph export, `flywheel_import_subgraph` may be appropriate.
49
- - If it is a markdown/wiki/blog/README corpus, paper, or research note set, port it explicitly with node and artifact tools.
49
+ - Otherwise, route to one source reference in `references/` using the `Source Type Routing` section below.
50
+ - Complete source routing before step 3 node mapping.
50
51
  3. Map each stable page, claim, or concept to a node.
51
52
  - For exact node-mutation shapes, load [references/flywheel-mcp-tool-map.md](references/flywheel-mcp-tool-map.md).
52
53
  - Create a new node with `flywheel_stage_node_create` when needed.
@@ -107,34 +108,38 @@ Canonical contract shape:
107
108
 
108
109
  The `Source corpus` and `Intended scope` lines are the recovery anchors for later authoring passes.
109
110
 
110
- ## Wiki Porting
111
+ ## Source Type Routing
111
112
 
112
- Use this guide when the source material is a markdown wiki, README corpus, or a Karpathy-style LLM wiki that should become Flywheel nodes.
113
+ Route every non-normalized source through one reference file before authoring.
113
114
 
114
- ### Default Mapping
115
+ Routing order:
115
116
 
116
- - One wiki page or stable concept -> one Flywheel node.
117
- - The main page markdown -> the node body/readme field (`content`).
118
- - A short synopsis of the page -> `summary`.
119
- - Images, PDFs, datasets, notebooks, code snippets, and other supporting files -> node artifacts.
120
- - Durable structural relationships -> graph edges.
121
- - Ordinary wiki hyperlinks -> remain markdown links inside the node body.
117
+ 1. Deterministic routing.
118
+ 2. Natural-language routing.
119
+ 3. Generic fallback.
122
120
 
123
- Do not try to preserve the source wiki as a file-first mirror inside Flywheel. Flywheel is node-first.
121
+ Deterministic routing rules:
124
122
 
125
- ### What The Model Should Do
123
+ - Local `.pdf` files -> `references/source-paper.md`
124
+ - `arxiv.org/abs/*`, `arxiv.org/pdf/*`, DOI URLs, direct PDF URLs -> `references/source-paper.md`
125
+ - Markdown files, wiki exports, wiki-like repositories -> `references/source-wiki.md`
126
+ - Blog/article domains and long-form article URLs -> `references/source-blog.md`
127
+ - Local notes trees (Obsidian, Logseq, plain markdown note directories) -> `references/source-notes.md`
126
128
 
127
- Assume the model is expected to perform the port directly unless the user explicitly asks to build a dedicated importer.
129
+ Natural-language routing rule:
128
130
 
129
- That means:
131
+ - If deterministic routing is inconclusive, use user intent from prompt/context
132
+ (for example, "import this paper", "graph this wiki", "convert this blog
133
+ post", "port these research notes") and pick the matching source reference.
130
134
 
131
- 1. Read the source pages and supporting files.
132
- 2. Create or update nodes explicitly.
133
- 3. Write the page body into node `content`.
134
- 4. Publish supporting files as artifacts.
135
- 5. Add only the graph edges that materially help reasoning or navigation.
135
+ Generic fallback rule:
136
136
 
137
- Do not wait for a magical bulk-import surface if the available Flywheel primitives are already enough.
137
+ - If deterministic and natural-language routing are both inconclusive, load
138
+ `references/source-generic.md`.
139
+
140
+ After choosing a source type, load that reference and follow its acquisition,
141
+ parsing, decomposition, artifact, and failure contracts for the rest of the
142
+ authoring pass.
138
143
 
139
144
  ## `flywheel_import_subgraph`
140
145
 
@@ -183,5 +188,6 @@ Guidelines:
183
188
  - Do not hide spend behind the flywheel-to-graph skill.
184
189
  - Build the graph explicitly with nodes, artifacts, and selected edges.
185
190
  - Keep the source material legible in `content`; do not dump everything into artifacts.
191
+ - These source-to-graph authoring-only rules apply only when $flywheel-to-graph is the active skill.
186
192
 
187
193
  See also: invoke `$flywheel-reproduce` to graphify claim-bearing sources and run budgeted validation branches, invoke `$flywheel-lookahead` to stage next-step frontier nodes from existing graph state without execution, and invoke `$flywheel-auto` to advance a frontier autonomously under an explicit budget and persisted stop condition.
@@ -14,7 +14,13 @@
14
14
  {
15
15
  "id": "claim-bearing-paper-without-execution",
16
16
  "prompt": "Use $flywheel-to-graph to structure this claim-bearing paper into Flywheel nodes and artifacts, but do not run any validation branches yet.",
17
- "expected_output": "Port the paper into nodes, artifacts, and durable edges without hidden execution or compute acquisition, leaving any later empirical validation to `$flywheel-reproduce`.",
17
+ "expected_output": "Create a parent paper node under the requested root, decompose the paper into section child nodes, keep section narratives in each child `content`, attach the PDF to the parent node, and avoid hidden execution or compute acquisition. Do NOT produce a single `insight` node with the PDF as the only artifact.",
18
+ "files": []
19
+ },
20
+ {
21
+ "id": "paper-pdf-decomposes-into-section-children",
22
+ "prompt": "Use $flywheel-to-graph on the paper PDF in the current folder and attach the result under an existing root node.",
23
+ "expected_output": "Create a parent paper node under the root, add one child node per top-level paper section (for example Abstract, Introduction, Methods, Results, Discussion, Conclusion), place each section narrative in child `content`, and attach the PDF artifact on the parent. Do NOT emit a single `insight` node with only a summary and the PDF artifact.",
18
24
  "files": []
19
25
  }
20
26
  ]