@kontourai/flow-agents 2.4.0 → 3.0.0
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/.github/CODEOWNERS +8 -0
- package/.github/workflows/ci.yml +12 -0
- package/.github/workflows/trust-reconcile.yml +62 -4
- package/CHANGELOG.md +23 -0
- package/CONTEXT.md +21 -0
- package/build/src/cli/assignment-provider.d.ts +1 -0
- package/build/src/cli/assignment-provider.js +748 -0
- package/build/src/cli/effective-assignment-provider-settings.d.ts +1 -0
- package/build/src/cli/effective-assignment-provider-settings.js +125 -0
- package/build/src/cli/validate-workflow-artifacts.js +5 -1
- package/build/src/cli/workflow-sidecar.js +157 -110
- package/build/src/cli.js +6 -0
- package/build/src/tools/validate-source-tree.js +1 -0
- package/context/contracts/artifact-contract.md +2 -0
- package/context/contracts/assignment-provider-contract.md +239 -0
- package/context/contracts/builder-kit-workflow-state-contract.md +2 -0
- package/context/contracts/decision-registry-contract.md +2 -0
- package/context/contracts/delivery-contract.md +2 -0
- package/context/contracts/execution-contract.md +25 -0
- package/context/contracts/governance-adapter-contract.md +2 -0
- package/context/contracts/knowledge-store-contract.md +197 -0
- package/context/contracts/planning-contract.md +2 -0
- package/context/contracts/review-contract.md +2 -0
- package/context/contracts/sandbox-policy.md +2 -0
- package/context/contracts/standing-directives.md +13 -0
- package/context/contracts/verification-contract.md +2 -0
- package/context/contracts/work-item-contract.md +2 -0
- package/context/settings/assignment-provider-settings.json +33 -0
- package/docs/adr/0022-fail-closed-delivery-reconciliation-with-governed-exemptions.md +180 -0
- package/docs/context-map.md +1 -0
- package/docs/decisions/index.md +3 -0
- package/docs/decisions/knowledge-store-provider.md +51 -0
- package/docs/decisions/model-routing.md +63 -0
- package/docs/decisions/standing-directives.md +66 -0
- package/docs/fixture-ownership.md +1 -0
- package/docs/workflow-shared-contracts.md +2 -1
- package/docs/workflow-usage-guide.md +6 -0
- package/evals/ci/run-baseline.sh +6 -0
- package/evals/fixtures/assignment-provider/actor-a.json +6 -0
- package/evals/fixtures/assignment-provider/actor-b.json +6 -0
- package/evals/fixtures/assignment-provider/github-issue-claimed.json +27 -0
- package/evals/fixtures/assignment-provider/github-issue-unassigned.json +7 -0
- package/evals/fixtures/assignment-provider/liveness-fresh.json +9 -0
- package/evals/fixtures/assignment-provider/liveness-stale.json +9 -0
- package/evals/integration/test_assignment_provider_github.sh +318 -0
- package/evals/integration/test_assignment_provider_local_file.sh +222 -0
- package/evals/integration/test_critique_supersession_roundtrip.sh +182 -0
- package/evals/integration/test_fixture_retirement_audit.sh +2 -2
- package/evals/integration/test_publish_delivery.sh +21 -4
- package/evals/integration/test_pull_work_assignment_join.sh +132 -0
- package/evals/integration/test_pull_work_liveness_preflight.sh +14 -6
- package/evals/integration/test_reconcile_soundness.sh +33 -9
- package/evals/integration/test_trust_reconcile.sh +9 -8
- package/evals/integration/test_trust_reconcile_negatives.sh +608 -0
- package/evals/integration/test_workflow_sidecar_writer.sh +79 -0
- package/evals/run.sh +10 -0
- package/evals/static/test_flowdef_codeowners_coverage.sh +6 -0
- package/evals/static/test_knowledge_providers.sh +23 -0
- package/kits/builder/skills/deliver/SKILL.md +19 -0
- package/kits/builder/skills/pull-work/SKILL.md +78 -10
- package/kits/knowledge/kit.json +35 -0
- package/kits/knowledge/providers/conformance/fixtures/git-repo/CONTEXT.md +12 -0
- package/kits/knowledge/providers/conformance/fixtures/git-repo/docs/decisions/old-sprocket-shape.md +13 -0
- package/kits/knowledge/providers/conformance/fixtures/git-repo/docs/decisions/sprocket-shape.md +14 -0
- package/kits/knowledge/providers/conformance/fixtures/git-repo/docs/decisions/widget-format.md +14 -0
- package/kits/knowledge/providers/conformance/fixtures/git-repo/docs/learnings/fixture-learning.md +7 -0
- package/kits/knowledge/providers/conformance/fixtures/work-item/issues.json +30 -0
- package/kits/knowledge/providers/conformance/suite.test.js +125 -0
- package/kits/knowledge/providers/git-repo/index.js +236 -0
- package/kits/knowledge/providers/health/health-pass.test.js +99 -0
- package/kits/knowledge/providers/health/index.js +153 -0
- package/kits/knowledge/providers/index.js +24 -0
- package/kits/knowledge/providers/lib/model.js +91 -0
- package/kits/knowledge/providers/lib/schema-validate.js +119 -0
- package/kits/knowledge/providers/markdown-vault/index.js +169 -0
- package/kits/knowledge/providers/work-item/index.js +204 -0
- package/package.json +4 -2
- package/schemas/assignment-provider-settings.schema.json +125 -0
- package/schemas/knowledge/edge.schema.json +54 -0
- package/schemas/knowledge/health-report.schema.json +45 -0
- package/schemas/knowledge/node.schema.json +49 -0
- package/schemas/knowledge/proposal.schema.json +53 -0
- package/scripts/ci/trust-reconcile.js +521 -24
- package/src/cli/assignment-provider.ts +845 -0
- package/src/cli/effective-assignment-provider-settings.ts +112 -0
- package/src/cli/validate-workflow-artifacts.ts +5 -1
- package/src/cli/workflow-sidecar.ts +147 -106
- package/src/cli.ts +6 -0
- package/src/tools/validate-source-tree.ts +1 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://flow-agents.dev/schemas/knowledge/edge.schema.json",
|
|
4
|
+
"title": "Knowledge Graph Edge",
|
|
5
|
+
"description": "A typed, directed edge between two nodes. The edge-type vocabulary is CLOSED (unlike node types): supersedes, merged-into, blocks, evidence-of, mentions, relates. Every edge carries provenance. The `to` endpoint MAY reference a node that is not present in the graph (an external or dangling reference); `resolved` records whether the provider expects the target to resolve, which the dependency-link-integrity health verb uses to separate deliberate external refs from broken links.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["id", "type", "from", "to", "provenance"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"id": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"minLength": 1,
|
|
13
|
+
"description": "Provider-scoped stable identifier for the edge."
|
|
14
|
+
},
|
|
15
|
+
"type": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"enum": ["supersedes", "merged-into", "blocks", "evidence-of", "mentions", "relates"],
|
|
18
|
+
"description": "supersedes: from replaces to. merged-into: from was folded into to. blocks: from must complete before to. evidence-of: from is provenance/evidence for to. mentions: from references to in prose. relates: general undirected-ish association."
|
|
19
|
+
},
|
|
20
|
+
"from": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 1,
|
|
23
|
+
"description": "Source node id."
|
|
24
|
+
},
|
|
25
|
+
"to": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"minLength": 1,
|
|
28
|
+
"description": "Target node id. MAY be a node id not present in the graph when `resolved` is false (external ref)."
|
|
29
|
+
},
|
|
30
|
+
"resolved": {
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"description": "true (default when omitted) means the provider expects `to` to resolve to a node in the same graph; a missing target is then a broken link. false means `to` is a deliberate external reference (e.g. evidence-of a PR outside the store) and MUST NOT be flagged as broken."
|
|
33
|
+
},
|
|
34
|
+
"attributes": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"description": "Provider-specific structured fields for the edge."
|
|
37
|
+
},
|
|
38
|
+
"provenance": { "$ref": "#/$defs/provenance" }
|
|
39
|
+
},
|
|
40
|
+
"$defs": {
|
|
41
|
+
"provenance": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"additionalProperties": false,
|
|
44
|
+
"required": ["provider", "source", "retrieved_at"],
|
|
45
|
+
"properties": {
|
|
46
|
+
"provider": { "type": "string", "minLength": 1 },
|
|
47
|
+
"source": { "type": "string", "minLength": 1 },
|
|
48
|
+
"locator": { "type": "string" },
|
|
49
|
+
"retrieved_at": { "type": "string", "minLength": 1 },
|
|
50
|
+
"agent": { "type": "string" }
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://flow-agents.dev/schemas/knowledge/health-report.schema.json",
|
|
4
|
+
"title": "Knowledge Health Report",
|
|
5
|
+
"description": "The schema-valid output of a provider-agnostic health verb (duplicate detection, dependency-link integrity). The same report shape is produced regardless of which provider supplied the graph, which is what lets one health command run identically over vault, git-repo, and work-item.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["schema_version", "check", "provider", "generated_at", "summary", "findings"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schema_version": { "const": "1.0" },
|
|
11
|
+
"check": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"enum": ["duplicate-detection", "dependency-link-integrity"],
|
|
14
|
+
"description": "Which health verb produced the report."
|
|
15
|
+
},
|
|
16
|
+
"provider": { "type": "string", "minLength": 1, "description": "Provider id the graph was read from." },
|
|
17
|
+
"generated_at": { "type": "string", "minLength": 1 },
|
|
18
|
+
"summary": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"additionalProperties": false,
|
|
21
|
+
"required": ["nodes_examined", "edges_examined", "finding_count"],
|
|
22
|
+
"properties": {
|
|
23
|
+
"nodes_examined": { "type": "integer" },
|
|
24
|
+
"edges_examined": { "type": "integer" },
|
|
25
|
+
"finding_count": { "type": "integer" }
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"findings": {
|
|
29
|
+
"type": "array",
|
|
30
|
+
"items": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"additionalProperties": false,
|
|
33
|
+
"required": ["kind", "severity", "message", "evidence"],
|
|
34
|
+
"properties": {
|
|
35
|
+
"kind": { "type": "string", "minLength": 1 },
|
|
36
|
+
"severity": { "type": "string", "enum": ["info", "warning", "error"] },
|
|
37
|
+
"node_ids": { "type": "array", "items": { "type": "string" } },
|
|
38
|
+
"edge_ids": { "type": "array", "items": { "type": "string" } },
|
|
39
|
+
"message": { "type": "string", "minLength": 1 },
|
|
40
|
+
"evidence": { "type": "object" }
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://flow-agents.dev/schemas/knowledge/node.schema.json",
|
|
4
|
+
"title": "Knowledge Graph Node",
|
|
5
|
+
"description": "A typed node in the Knowledge Kit graph model. type is EXTENSIBLE: the recommended core vocabulary is note, decision, issue, session, person, but providers MAY emit additional types. Every node carries provenance so any assertion can be traced back to the store it came from.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["id", "type", "title", "provenance"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"id": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"minLength": 1,
|
|
13
|
+
"description": "Provider-scoped stable identifier, unique within a single readGraph result."
|
|
14
|
+
},
|
|
15
|
+
"type": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"minLength": 1,
|
|
18
|
+
"description": "Node type. Recommended core vocabulary: note, decision, issue, session, person. Extensible — unknown types MUST NOT be rejected."
|
|
19
|
+
},
|
|
20
|
+
"title": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 1,
|
|
23
|
+
"description": "Human-readable title used for display and duplicate detection."
|
|
24
|
+
},
|
|
25
|
+
"body": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Primary content. Format is provider/type-specific."
|
|
28
|
+
},
|
|
29
|
+
"attributes": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"description": "Provider-specific structured fields (e.g. issue state/labels, decision status, note category/tags)."
|
|
32
|
+
},
|
|
33
|
+
"provenance": { "$ref": "#/$defs/provenance" }
|
|
34
|
+
},
|
|
35
|
+
"$defs": {
|
|
36
|
+
"provenance": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"required": ["provider", "source", "retrieved_at"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"provider": { "type": "string", "minLength": 1, "description": "Provider id that produced this element (e.g. markdown-vault, git-repo, work-item)." },
|
|
42
|
+
"source": { "type": "string", "minLength": 1, "description": "The concrete origin: a file path, an issue ref, or a URL." },
|
|
43
|
+
"locator": { "type": "string", "description": "Optional finer locator within the source (line, anchor, frontmatter field)." },
|
|
44
|
+
"retrieved_at": { "type": "string", "minLength": 1, "description": "ISO-8601 timestamp the element was read." },
|
|
45
|
+
"agent": { "type": "string", "description": "Optional agent/process id that performed the read." }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://flow-agents.dev/schemas/knowledge/proposal.schema.json",
|
|
4
|
+
"title": "Knowledge Store Write Proposal",
|
|
5
|
+
"description": "The ONLY write artifact a knowledge store provider may emit. Providers over human-curated stores are proposals-only: proposeWrite() never mutates the store and can only ever return a Proposal whose status is the const \"proposed\". Enactment happens downstream (a human edit, the decision-registry promote step, or a gh comment/label the operator files) — never inside the provider. The `rendered` field carries the provider-native form the enactor would apply (decision-registry topic frontmatter for git-repo; an issue comment/label body for work-item; a vault note with frontmatter+wikilinks for markdown-vault).",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["schema_version", "provider", "kind", "target", "status", "provenance"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schema_version": { "const": "1.0" },
|
|
11
|
+
"provider": { "type": "string", "minLength": 1 },
|
|
12
|
+
"kind": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"enum": ["create-node", "update-node", "add-edge", "comment", "label", "decision-topic"],
|
|
15
|
+
"description": "The shape of the proposed change."
|
|
16
|
+
},
|
|
17
|
+
"target": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"description": "Where the change would land if enacted (file path, issue number, store id). Descriptive only — the provider does not touch it."
|
|
20
|
+
},
|
|
21
|
+
"payload": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"description": "The structured node/edge/field the proposal would introduce."
|
|
24
|
+
},
|
|
25
|
+
"rendered": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "The provider-native rendered form an enactor would apply (topic-file frontmatter, gh comment body, vault note)."
|
|
28
|
+
},
|
|
29
|
+
"status": {
|
|
30
|
+
"const": "proposed",
|
|
31
|
+
"description": "Always the literal \"proposed\". A provider can NEVER return an applied proposal — this const is the structural expression of proposals-only discipline."
|
|
32
|
+
},
|
|
33
|
+
"rationale": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "Why the change is proposed."
|
|
36
|
+
},
|
|
37
|
+
"provenance": { "$ref": "#/$defs/provenance" }
|
|
38
|
+
},
|
|
39
|
+
"$defs": {
|
|
40
|
+
"provenance": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"additionalProperties": false,
|
|
43
|
+
"required": ["provider", "source", "retrieved_at"],
|
|
44
|
+
"properties": {
|
|
45
|
+
"provider": { "type": "string", "minLength": 1 },
|
|
46
|
+
"source": { "type": "string", "minLength": 1 },
|
|
47
|
+
"locator": { "type": "string" },
|
|
48
|
+
"retrieved_at": { "type": "string", "minLength": 1 },
|
|
49
|
+
"agent": { "type": "string" }
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|