Formal edges from the Lean build
Extract ELABORATED formal dependencies between a folio’s lean.ref declarations (LeanArchitect’s rule over the folio’s own lean.ref set). Needs a Lean toolchain and a built Lake project. Tagged declarations missing from the build are reported, never recorded as dependency-free; with ingest the result is recorded in the formal cache as source “elaborated”.
Skills it satisfies
A skill states the capability; this Tool is one way to exercise it. Each skill’s declared input and output contract follows, where it has one.
lean-formal-edges
Extract ELABORATED formal dependencies between a folio’s lean.ref declarations — the trustworthy replacement for the lexical --scan cache. Use when the formal graph matters (impact analysis, staleness, a blueprint’s \uses), when lean-formal-graph reports source “scan”, or before trusting a type/value split.
Source: folio-assistant-sci/skills/lean/lean-formal-edges.md.
The skill declares no I/O contract (schemas/skills/lean-formal-edges/{input,output}.schema.json).
Inputs and outputs
Each port names a shared type by IRI, so two Tools for one skill can be checked for interchangeability.
| port | type | required | description | constraint | |
|---|---|---|---|---|---|
| in | lake_dir | RepoPath | yes | The folio’s Lake project directory (holds lakefile.* and .lake/). | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. |
| in | root | RepoPath | Content root to collect lean.ref targets from (default: the folio’s declared one). | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. | |
| in | ingest | Flag | Record the result in the formal cache as source “elaborated”. | boolean · A boolean switch — projects to a bare flag, with no value word | |
| out | report | Markdown | The extracted edges, or why they could not be determined — never an empty edge set in place of a failure. | string · Markdown text. Not admissible as a command-line argument — see INJECTION_SAFE. |
Processes and tasks
No process step names a skill this Tool satisfies.
How it is deployed and reached
- MCP. Served as
lean_formal_edgesbysage(cat-harness-tools/scripts/sage-mcp.sh),google-drive(cat-harness-tools/scripts/google-drive-mcp.sh),folio-assistant(bun run cat-harness-tools/src/index.ts --stdio --repo .), the servers.mcp.jsondeclares. - In process.
pipeline/formal-edges-mcp.ts— loaded by the harness directly, with no server. - GitHub Actions. No workflow in this checkout runs its command.
The MCP tool it serves, as tools/list answers:
lean_formal_edges — read from its registrar.
| parameter | type | required | description |
|---|---|---|---|
lake_dir | string | yes | The folio’s Lake project directory (holds lakefile.* and .lake/) |
root | string | Content root to collect lean.ref targets from (default: the folio’s declared one) | |
ingest | boolean | Record the result in the formal cache as source “elaborated” |
As an API: its operation in the OpenAPI document and the MCP tool list of its layer.
| install | none |
| runtime | bun, lake |
| network | no |
What it is made of
| role | file | |
|---|---|---|
| definition | folio-assistant-sci/tools/lean-formal-edges/lean-formal-edges.ts | |
| in-process module | folio-assistant-sci/pipeline/formal-edges-mcp.ts |
Linked data
The Tool is published as its own JSON-LD document at its IRI, https://litlfred.github.io/folio-assistant/folio-assistant-sci/tools/lean-formal-edges.jsonld, partOf its layer’s document. The node below is the definition this page was drawn from, and is embedded in the page as application/ld+json.
{
"@context": "https://litlfred.github.io/folio-assistant/folio-assistant-sci/folio-assistant-sci.context.jsonld",
"@id": "https://litlfred.github.io/folio-assistant/folio-assistant-sci/tools/lean-formal-edges.jsonld",
"@type": "https://litlfred.github.io/cat-harness/v0/ns/Tool",
"partOf": "https://litlfred.github.io/folio-assistant/folio-assistant-sci/folio-assistant-sci.jsonld",
"name": "lean-formal-edges",
"title": "Formal edges from the Lean build",
"description": "Extract ELABORATED formal dependencies between a folio's lean.ref declarations (LeanArchitect's rule over the folio's own lean.ref set). Needs a Lean toolchain and a built Lake project. Tagged declarations missing from the build are reported, never recorded as dependency-free; with ingest the result is recorded in the formal cache as source \"elaborated\".",
"install": {
"none": true
},
"invoke": {
"mcp": {
"tool": "lean_formal_edges"
},
"inProcess": {
"module": "pipeline/formal-edges-mcp.ts"
}
},
"io": {
"inputs": [
{
"name": "lake_dir",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "The folio's Lake project directory (holds lakefile.* and .lake/).",
"required": true
},
{
"name": "root",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "Content root to collect lean.ref targets from (default: the folio's declared one).",
"required": false
},
{
"name": "ingest",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Flag",
"description": "Record the result in the formal cache as source \"elaborated\".",
"required": false
}
],
"outputs": [
{
"name": "report",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Markdown",
"description": "The extracted edges, or why they could not be determined — never an empty edge set in place of a failure."
}
]
},
"satisfies": [
"lean-formal-edges"
],
"requirements": {
"runtime": [
"bun",
"lake"
],
"network": false
}
}