Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

### Added

- **Structural-history Echo package descriptor**: Graft now carries a
deterministic descriptor for the structural-history package it expects Echo
to host later, with repo-root-relative schema and generated-artifact
identities, descriptor-only Echo posture, and a local drift check wired into
`pnpm schema:structural-history:check`.
- **Structural history schema authority**: Graft now carries a canonical
`schemas/graft-structural-history.graphql` schema with Wesley-generated
TypeScript contracts and a deterministic artifact drift check, establishing
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# CORE graft structural-history Echo package descriptor

## Status

Active slice.

## Hill

Graft publishes a deterministic, repo-local descriptor for the
structural-history contract package it expects Echo to host later, without
requiring any Echo runtime behavior in this slice.

## Why this slice does not require Echo changes

Echo is the substrate target. This slice only records the package facts Graft
will eventually hand to that substrate:

- package identity;
- schema identity;
- generated TypeScript artifact identity;
- Wesley generator identity;
- exposed structural-history record, evidence, and operation names;
- explicit descriptor-only Echo posture.

No package is installed into Echo. No Echo storage, replay, query execution, or
TypeScript client binding is invoked. The descriptor is therefore a Graft-owned
contract artifact, not an Echo feature request.

If a later slice discovers that Echo cannot accept this package shape, that
becomes a separate Echo planning item with concrete evidence. This slice should
not pre-emptively expand Echo.

## Acceptance Criteria

1. Graft has a checked-in structural-history Echo package descriptor.
2. The descriptor is deterministic and derived from existing schema authority
facts plus `package.json` identity.
3. Descriptor paths are repo-root-relative and never machine-local absolute
paths.
4. `pnpm schema:structural-history:check` fails when the descriptor drifts.
5. The descriptor explicitly states that Echo runtime installation and package
installation are not required in this slice.

## Descriptor Surface

Descriptor path:
`schemas/graft-structural-history.echo-package.json`

The descriptor records:

| Section | Meaning |
| :--- | :--- |
| `descriptorVersion` | Version of the descriptor format itself. |
| `package` | Graft-owned Echo package identity and source package version. |
| `schema` | GraphQL schema path, hash, and Wesley L1 registry hash. |
| `generatedArtifacts` | Wesley-generated TypeScript artifact path, hash, and generator version. |
| `echo` | Descriptor-only Echo posture for this slice. |
| `contracts` | Required record types, evidence labels, and operation constants. |

## Drift Model

The descriptor is checked by
`scripts/check-structural-history-echo-package.ts`.

The checker rebuilds the expected descriptor from:

- `schemas/graft-structural-history.manifest.json`;
- `package.json`.

It then byte-compares the checked-in descriptor against the deterministic JSON
rendering. Hand-editing descriptor fields, changing package identity, changing
schema hash facts, or introducing absolute paths fails the Graft-local check.

## Test Strategy

Focused contract tests cover:

1. the checked-in descriptor matching the deterministic expected descriptor;
2. descriptor-only Echo posture and repo-root-relative paths;
3. stale descriptor drift producing a local check violation.

The script is also wired into `pnpm schema:structural-history:check`, which is
already part of release checks.

## Non-goals

- Do not change Echo.
- Do not change Wesley semantics.
- Do not install a package into Echo.
- Do not claim Echo-backed storage, replay, or query execution is active.
- Do not add a real Echo TypeScript client binding in this slice.

## Playback Questions

1. Can a reviewer identify exactly which package Graft expects Echo to host
later?
2. Can a reviewer prove the descriptor came from the schema authority manifest
and package identity rather than hand-edited hope?
3. Can a reviewer see that Echo runtime behavior remains out of scope?
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ would Graft hand to Echo?" It should not require Echo to run that package yet.
## Design Packet

Primary design packet:
[`docs/design/CORE_graft-structural-history-echo-package-descriptor.md`](../../../design/CORE_graft-structural-history-echo-package-descriptor.md)

Parent requirements packet:
[`docs/design/CORE_graft-echo-typescript-integration-requirements.md`](../../../design/CORE_graft-echo-typescript-integration-requirements.md)

Related migration card:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"test:watch": "vitest",
"lint": "eslint .",
"typecheck": "tsc --noEmit",
"schema:structural-history:check": "tsx scripts/check-structural-history-schema-artifacts.ts",
"schema:structural-history:check": "tsx scripts/check-structural-history-schema-artifacts.ts && tsx scripts/check-structural-history-echo-package.ts",
"pack:check": "pnpm pack --dry-run",
"guard:agent-worktrees": "tsx scripts/check-agent-worktree-hygiene.ts",
"security:check": "tsx scripts/check-release-security.ts",
Expand Down
61 changes: 61 additions & 0 deletions schemas/graft-structural-history.echo-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"descriptorVersion": 1,
"package": {
"id": "graft.structural-history",
"kind": "echo-contract-package",
"sourcePackageName": "@flyingrobots/graft",
"sourcePackageVersion": "0.8.0"
},
"schema": {
"format": "graphql",
"path": "schemas/graft-structural-history.graphql",
"sha256": "20c335b4510efbfb5a57a61706bea28a7f82bfc063036b013bd19dc8176905ec",
"wesleyL1RegistryHash": "1f0956170eeec399e942fa8e418a4f23bc12ec40bf25f6e1de9510abbb15b832"
},
"generatedArtifacts": [
{
"kind": "typescript",
"path": "src/generated/graft-structural-history.ts",
"sha256": "79737d3c089067685d553f9526c8eb442cb7a20c099a49a771162c2be29559cc",
"generator": {
"name": "wesley",
"version": "0.0.4"
}
}
],
"echo": {
"runtimeRequired": false,
"packageInstallationRequired": false,
"integrationStage": "descriptor-only",
"typescriptClientBinding": "planned"
},
"contracts": {
"recordTypes": [
"StructuralRepository",
"StructuralBasis",
"StructuralFileVersion",
"StructuralSourceSpan",
"StructuralParserRun",
"StructuralSymbol",
"StructuralSymbolRelation",
"StructuralReadingEvidence",
"StructuralReading",
"GitWarpImportBatch"
],
"evidenceLabels": [
"ECHO_NATIVE",
"GIT_WARP_IMPORTED",
"FALLBACK_TRANSLATED"
],
"operations": [
"queryStructuralRepositoriesOperation",
"queryStructuralBasesOperation",
"queryStructuralFileVersionsOperation",
"queryStructuralSymbolsOperation",
"queryStructuralSymbolRelationsOperation",
"queryStructuralReadingsOperation",
"queryStructuralReadingEvidenceOperation",
"queryGitWarpImportBatchesOperation"
]
}
}
Loading
Loading