agent-doc-system 0.0.0-stage → 1.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/INSTALL_FOR_AGENTS.md +60 -0
- package/LICENSE +21 -0
- package/README.md +151 -2
- package/adapters/cache.mjs +27 -0
- package/adapters/contract-consumers.mjs +56 -0
- package/adapters/database.mjs +116 -0
- package/adapters/deploy-config.mjs +34 -0
- package/adapters/dockerfile.mjs +26 -0
- package/adapters/events.mjs +145 -0
- package/adapters/generic.mjs +86 -0
- package/adapters/github-actions.mjs +106 -0
- package/adapters/go.mjs +91 -0
- package/adapters/graphql.mjs +28 -0
- package/adapters/index.mjs +55 -0
- package/adapters/node.mjs +118 -0
- package/adapters/object-store.mjs +64 -0
- package/adapters/oidc.mjs +56 -0
- package/adapters/openapi.mjs +50 -0
- package/adapters/pnpm.mjs +42 -0
- package/adapters/protobuf.mjs +35 -0
- package/adapters/registry.mjs +27 -0
- package/adapters/resource-client.mjs +61 -0
- package/adapters/turborepo.mjs +135 -0
- package/adapters/typescript.mjs +85 -0
- package/adapters/wrangler.mjs +206 -0
- package/bin/agentdoc.mjs +478 -0
- package/bin/usage.txt +26 -0
- package/core/acceptances.mjs +69 -0
- package/core/audit.mjs +407 -0
- package/core/authority/classes.mjs +39 -0
- package/core/authority/engine.mjs +243 -0
- package/core/authority/facts.mjs +41 -0
- package/core/codes.mjs +119 -0
- package/core/compile.mjs +881 -0
- package/core/contracts.mjs +121 -0
- package/core/derive.mjs +102 -0
- package/core/descriptors.mjs +486 -0
- package/core/determinism.mjs +95 -0
- package/core/discover.mjs +147 -0
- package/core/facts.mjs +53 -0
- package/core/fsx.mjs +342 -0
- package/core/graph.mjs +260 -0
- package/core/impact.mjs +175 -0
- package/core/indexes.mjs +165 -0
- package/core/jsonschema.mjs +298 -0
- package/core/observations.mjs +129 -0
- package/core/provenance.mjs +83 -0
- package/core/query.mjs +384 -0
- package/core/relations.mjs +286 -0
- package/core/scaffold.mjs +322 -0
- package/core/secrets.mjs +92 -0
- package/core/sourcescan.mjs +88 -0
- package/core/toml.mjs +163 -0
- package/core/yaml.mjs +475 -0
- package/docs/ADAPTERS.md +172 -0
- package/docs/AUTHORITY.md +260 -0
- package/docs/CI.md +136 -0
- package/docs/COMPARISON-KODA.md +164 -0
- package/docs/EVALS.md +166 -0
- package/docs/MIGRATION.md +193 -0
- package/docs/PROVENANCE.md +133 -0
- package/docs/QUERY.md +180 -0
- package/docs/SPEC.md +339 -0
- package/docs/VERIFICATION.md +28 -0
- package/docs/ci/generic-ci.sh +28 -0
- package/docs/ci/github-actions.yml +35 -0
- package/evals/harness.mjs +426 -0
- package/evals/scenarios/fixture-a-01-change-api.json +9 -0
- package/evals/scenarios/fixture-a-02-change-db.json +9 -0
- package/evals/scenarios/fixture-a-03-enforce-constraint.json +9 -0
- package/evals/scenarios/fixture-b-01-change-proto.json +9 -0
- package/evals/scenarios/fixture-b-02-change-write-path.json +9 -0
- package/evals/scenarios/fixture-b-03-change-shared-lib.json +9 -0
- package/evals/scenarios/fixture-b-04-journey.json +9 -0
- package/evals/scenarios/fixture-c-01-mixed-runtime-edge.json +19 -0
- package/evals/scenarios/fixture-c-02-stale-doc-contradiction.json +9 -0
- package/evals/scenarios/fixture-c-03-shared-vocabulary.json +9 -0
- package/evals/scenarios/fixture-c-04-contract-change.json +9 -0
- package/evals/scenarios/koda-01-modify-api-consumer.json +26 -0
- package/evals/scenarios/koda-02-change-db-schema.json +20 -0
- package/evals/scenarios/koda-03-change-auth.json +21 -0
- package/evals/scenarios/koda-04-add-event-producer.json +19 -0
- package/evals/scenarios/koda-05-modify-worker-binding.json +25 -0
- package/evals/scenarios/koda-06-change-cross-component-endpoint.json +22 -0
- package/evals/scenarios/koda-07-change-shared-package.json +16 -0
- package/evals/scenarios/koda-08-change-runtime-cron.json +23 -0
- package/evals/scenarios/koda-09-debug-production-mismatch.json +26 -0
- package/evals/thresholds.json +11 -0
- package/package.json +46 -4
- package/schemas/api.schema.json +84 -0
- package/schemas/common.schema.json +107 -0
- package/schemas/component.schema.json +40 -0
- package/schemas/config.schema.json +685 -0
- package/schemas/domain.schema.json +14 -0
- package/schemas/graph.schema.json +1084 -0
- package/schemas/journeys.schema.json +47 -0
- package/schemas/observation.schema.json +143 -0
- package/schemas/resource.schema.json +28 -0
- package/schemas/system.schema.json +26 -0
- package/skills/agent-doc-system/SKILL.md +113 -0
- package/skills/agent-doc-system/references/authority-and-conflicts.md +70 -0
- package/skills/agent-doc-system/references/cli.md +89 -0
- package/skills/agent-doc-system/references/create-migrate.md +101 -0
- package/skills/agent-doc-system/references/maintenance.md +52 -0
- package/templates/ADR.md +26 -0
- package/templates/ARCHITECTURE.md +19 -0
- package/templates/CONSTRAINTS.md +17 -0
- package/templates/PRODUCT.md +17 -0
- package/templates/api.yaml +10 -0
- package/templates/ci.yml +31 -0
- package/templates/component.yaml +14 -0
- package/templates/domain.yaml +6 -0
- package/templates/journey.yaml +7 -0
- package/templates/observation.yaml +19 -0
- package/templates/resource.yaml +8 -0
- package/templates/system.yaml +10 -0
- package/templates/warning-acceptance.yaml +14 -0
package/templates/ADR.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Architecture Decision Records
|
|
2
|
+
|
|
3
|
+
One file per decision: `NNNN-short-title.md`. An ADR records a decision and its
|
|
4
|
+
consequences, and is immutable once accepted — supersede it with a new ADR that
|
|
5
|
+
links back.
|
|
6
|
+
|
|
7
|
+
## Template
|
|
8
|
+
|
|
9
|
+
# NNNN. Short title in one imperative sentence
|
|
10
|
+
|
|
11
|
+
## Status
|
|
12
|
+
proposed | accepted | superseded by NNNN
|
|
13
|
+
|
|
14
|
+
## Context
|
|
15
|
+
What was true before this decision. Facts, with evidence.
|
|
16
|
+
|
|
17
|
+
## Decision
|
|
18
|
+
What was decided, in one sentence.
|
|
19
|
+
|
|
20
|
+
## Consequences
|
|
21
|
+
What becomes easier, what becomes harder, and what is now forbidden.
|
|
22
|
+
|
|
23
|
+
## Evidence class of each claim
|
|
24
|
+
Which parts are authored intent, which are derived from code, and which
|
|
25
|
+
were observed in a running system. Disagreement between them is the point
|
|
26
|
+
of this section, not a flaw in it.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
This file explains *why the shape is what it is*. It does not enumerate
|
|
4
|
+
components, contracts or data stores: `agentdoc query` returns those from the
|
|
5
|
+
compiled graph, and a hand-maintained list would be wrong within a week.
|
|
6
|
+
|
|
7
|
+
## How to read the system
|
|
8
|
+
- `agentdoc query <path>` for one component and its boundaries.
|
|
9
|
+
- `agentdoc impact <paths>` for what a change forces you to keep consistent.
|
|
10
|
+
- `agentdoc audit` for the current classification of every fact.
|
|
11
|
+
|
|
12
|
+
## Structural decisions
|
|
13
|
+
<!-- One entry per decision, each linking to the ADR that records it. -->
|
|
14
|
+
|
|
15
|
+
## Boundaries and why they exist
|
|
16
|
+
<!-- Which components may talk to which, and what enforces it. -->
|
|
17
|
+
|
|
18
|
+
## Deliberate non-relationships
|
|
19
|
+
<!-- Things that look like they should be coupled and are not. -->
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Constraints
|
|
2
|
+
|
|
3
|
+
Repository-wide rules that an agent must not violate. Anything that is *not*
|
|
4
|
+
repository-wide belongs in the owning component's `CONSTRAINTS.md`, which the
|
|
5
|
+
graph routes to automatically.
|
|
6
|
+
|
|
7
|
+
## Rule format
|
|
8
|
+
One rule, one imperative sentence, one reason. A rule that cannot be checked by
|
|
9
|
+
reading code or running a command belongs in an ADR, not here.
|
|
10
|
+
|
|
11
|
+
## Rules
|
|
12
|
+
- <!-- rule -->
|
|
13
|
+
- Reason: <!-- why -->
|
|
14
|
+
- Checked by: <!-- command or test that proves it -->
|
|
15
|
+
|
|
16
|
+
## Changing a rule
|
|
17
|
+
A rule change is an ADR. Record why the old rule stopped being true.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Product
|
|
2
|
+
|
|
3
|
+
## What this is
|
|
4
|
+
<!-- One paragraph. The product in the words a user would use. -->
|
|
5
|
+
|
|
6
|
+
## Who it is for
|
|
7
|
+
<!-- The actors, and nothing else. -->
|
|
8
|
+
|
|
9
|
+
## What it promises
|
|
10
|
+
<!-- The behaviours a user can rely on. Each one must be observable somewhere. -->
|
|
11
|
+
|
|
12
|
+
## What it explicitly does not do
|
|
13
|
+
<!-- Non-goals. This section prevents more drift than any other. -->
|
|
14
|
+
|
|
15
|
+
## Vocabulary
|
|
16
|
+
<!-- Domain terms and their exact meaning. Point at the Domain entity rather
|
|
17
|
+
than restating it: the graph already carries the definition. -->
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
apiVersion: agentdoc.dev/v1
|
|
2
|
+
kind: API
|
|
3
|
+
metadata:
|
|
4
|
+
name: example-api
|
|
5
|
+
description: "Canonical JSON HTTP surface served by the example component."
|
|
6
|
+
spec:
|
|
7
|
+
type: openapi
|
|
8
|
+
provider: component:default/example-service
|
|
9
|
+
contract:
|
|
10
|
+
ref: contracts/example.openapi.yaml
|
package/templates/ci.yml
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Drift gate. The graph is a build artifact: compile it, then prove the
|
|
2
|
+
# committed one is byte-identical to a fresh compile. A stale or hand-edited
|
|
3
|
+
# graph fails here, not in someone's review three weeks later.
|
|
4
|
+
name: agentdoc
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
push:
|
|
8
|
+
branches: [main]
|
|
9
|
+
jobs:
|
|
10
|
+
agentdoc:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
timeout-minutes: 5
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
with: { fetch-depth: 0 }
|
|
16
|
+
- uses: actions/setup-node@v4
|
|
17
|
+
with: { node-version: '24' }
|
|
18
|
+
- name: Install the agentdoc CLI
|
|
19
|
+
# Unpinned tracks main. For CI reproducibility pin a tag or commit:
|
|
20
|
+
# github:lbframe/agent-doc-system#v1.0.0
|
|
21
|
+
# A compiler upgrade intentionally invalidates committed graphs.
|
|
22
|
+
run: npm install -g github:lbframe/agent-doc-system
|
|
23
|
+
- name: Validate and compile
|
|
24
|
+
run: |
|
|
25
|
+
agentdoc validate
|
|
26
|
+
agentdoc compile
|
|
27
|
+
agentdoc check
|
|
28
|
+
- name: Reject dirty sources
|
|
29
|
+
run: agentdoc check --require-clean
|
|
30
|
+
- name: Routing evaluation
|
|
31
|
+
run: agentdoc eval routing
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
apiVersion: agentdoc.dev/v1
|
|
2
|
+
kind: Component
|
|
3
|
+
metadata:
|
|
4
|
+
name: example-service
|
|
5
|
+
description: "Serves the example read model for the example domain."
|
|
6
|
+
spec:
|
|
7
|
+
type: service
|
|
8
|
+
# Choose exactly one of system, domain, or placementRationale.
|
|
9
|
+
system: example-system
|
|
10
|
+
context:
|
|
11
|
+
docs:
|
|
12
|
+
- services/example-service/README.md
|
|
13
|
+
constraints:
|
|
14
|
+
- services/example-service/CONSTRAINTS.md
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
apiVersion: agentdoc.dev/observation/v1
|
|
2
|
+
kind: ObservationSet
|
|
3
|
+
metadata:
|
|
4
|
+
name: production
|
|
5
|
+
description: "What the production platform reported for one observation window."
|
|
6
|
+
environment: production
|
|
7
|
+
capturedAt: "2026-01-01T00:00:00Z"
|
|
8
|
+
maxAgeDays: 30
|
|
9
|
+
sourceSystem: example-scheduler
|
|
10
|
+
collector: "example-cli schedules list --json"
|
|
11
|
+
evidenceBundle: agentdoc/observations/production/2026-01-01.json
|
|
12
|
+
provenance: "Collected during the scheduled change window; raw output committed verbatim."
|
|
13
|
+
spec:
|
|
14
|
+
facts:
|
|
15
|
+
- id: nightly-digest
|
|
16
|
+
subject: component:default/example-service
|
|
17
|
+
key: schedule.cron
|
|
18
|
+
value: "0 3 * * *"
|
|
19
|
+
semantics: "The expression the production scheduler actually evaluates for this trigger."
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Warning acceptances live in agentdoc/agentdoc.config.yaml. Each one must carry
|
|
2
|
+
# the evidence content hashes as they are *now*; `agentdoc validate` recomputes
|
|
3
|
+
# them and fails when the evidence has moved, forcing a fresh review.
|
|
4
|
+
warningAcceptances:
|
|
5
|
+
- code: AGENTDOC_SERVICE_BINDING_UNRESOLVED
|
|
6
|
+
subject: component:default/example-service
|
|
7
|
+
classification: INTENDED_DIVERGENCE
|
|
8
|
+
reason: "This divergence is intentional and will be reconciled in Q3."
|
|
9
|
+
reviewWhen: "Review when the platform migration lands or the divergence persists past its stated window."
|
|
10
|
+
observedRefs:
|
|
11
|
+
- component:default/example-service
|
|
12
|
+
evidence:
|
|
13
|
+
- path: services/example-service/wrangler.toml
|
|
14
|
+
sha256: "0000000000000000000000000000000000000000000000000000000000000000"
|