Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
f693fd3
docs: ADR batch for the agent object model
buchk Jul 22, 2026
76db9e5
feat: .tfer file format and a language server
buchk Jul 23, 2026
b1dbd6b
feat: typed-context semantics and tool dependencies
buchk Jul 23, 2026
b6c4df4
feat: capability exposure/visibility (ADR-0015)
buchk Jul 23, 2026
ec5b306
feat: sealing (mutability/presence) on skill bindings (ADR-0016)
buchk Jul 23, 2026
1b06575
feat: invocation-mode skill variants (ADR-0012)
buchk Jul 23, 2026
53e42f8
feat: fuller LSP — completion, definition, symbols, composition diagn…
buchk Jul 23, 2026
d2957e6
example: repo-agent exercising the full object model
buchk Jul 23, 2026
8a544ad
style: gofmt map-literal alignment in lsp server
buchk Jul 23, 2026
28b82f5
refactor: drop the C# implementation; Go is the sole implementation (…
buchk Jul 23, 2026
3055cf3
chore: remove stray codex attachment, gitignore the scratch dir
buchk Jul 23, 2026
6d0efcb
refactor: migrate examples/helio to the .tfer format
buchk Jul 23, 2026
4f0ce05
refactor: migrate examples/repo-agent to .tfer
buchk Jul 23, 2026
927cdec
refactor: migrate the self-hosted maintainer to .tfer
buchk Jul 23, 2026
88dc5b5
feat: emit callable-resource cards from exposed capabilities (ADR-0018)
buchk Jul 23, 2026
d0fd461
feat: callable card renders the a2a variant; accept implemented ADRs
buchk Jul 23, 2026
5b5aeec
feat: allowedContextTypes gating and per-variant requirements (ADR-00…
buchk Jul 23, 2026
d516bc9
feat: variant fan-out — per-mode SKILL.md in the neutral bundle (ADR-…
buchk Jul 23, 2026
a046e75
feat: schema-directed context fields (ADR-0013)
buchk Jul 23, 2026
bdfb34f
feat: VS Code editor client for the language server
buchk Jul 23, 2026
106b981
feat: publish edge verb (ADR-0018)
buchk Jul 23, 2026
c588531
feat: emit held context objects in the neutral bundle (ADR-0013)
buchk Jul 23, 2026
b2c79df
example: helio adopts the object-model features
buchk Jul 23, 2026
7dbe252
feat: inline held context content into compiled artifacts (ADR-0013)
buchk Jul 23, 2026
e6917b6
feat: targets select a surface-appropriate variant; deliver instructi…
buchk Jul 23, 2026
d434d9c
fix: refresh the maintainer definition for the Go-only pivot
buchk Jul 23, 2026
759e877
fix: review findings — wasm artifact, requiredFields, pathToURI, seal…
buchk Jul 23, 2026
183f4ba
feat: schema-directed field-type checking and a complete callable card
buchk Jul 23, 2026
009c00f
feat: callable card lists each capability's required tools (ADR-0017)
buchk Jul 23, 2026
d0b8b31
feat: emit conformant A2A Agent Cards and MCP tool manifests (ADR-0018)
buchk Jul 23, 2026
d4f9924
feat: ARD catalog carries official-typed A2A and MCP entries (ADR-0018)
buchk Jul 23, 2026
038cccc
feat: pure-standard ai-catalog.json + project manifest (no proprietar…
buchk Jul 23, 2026
6e83391
Merge remote-tracking branch 'origin/main' into feat/tfer-format-and-lsp
buchk Jul 28, 2026
44409e1
feat: required is a real presence axis (abstract requirements)
buchk Jul 29, 2026
c98ab99
fix: endpoints are authored, not invented
buchk Jul 29, 2026
0e3af74
docs: define closed restore build and link architecture
buchk Jul 29, 2026
96de709
feat: close source build and deployment semantics
buchk Jul 29, 2026
de42ee9
chore: regenerate canonical v4 artifacts
buchk Jul 29, 2026
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
67 changes: 25 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,6 @@ on:
pull_request:

jobs:
build-test-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: dotnet restore TypeFerence.slnx
- run: dotnet build TypeFerence.slnx --no-restore --configuration Release
- run: dotnet test TypeFerence.slnx --no-build --configuration Release
- run: dotnet src/TypeFerence.Cli/bin/Release/net10.0/typeference.dll build examples/helio --target all --out dist-ci-1 --emit-ard --publisher-domain helio.example
- run: dotnet src/TypeFerence.Cli/bin/Release/net10.0/typeference.dll build examples/helio --target all --out dist-ci-2 --emit-ard --publisher-domain helio.example
- run: diff -qr dist-ci-1 dist-ci-2
- run: pip install -r tools/requirements-docs.txt
- run: python tools/render_whitepaper.py
- run: cp output/pdf/typeference-whitepaper.pdf /tmp/typeference-whitepaper-first.pdf
- run: python tools/render_whitepaper.py
- run: cmp /tmp/typeference-whitepaper-first.pdf output/pdf/typeference-whitepaper.pdf
- run: sudo apt-get update && sudo apt-get install -y poppler-utils
- run: pdfinfo output/pdf/typeference-whitepaper.pdf

go-implementation:
runs-on: ubuntu-latest
steps:
Expand All @@ -44,8 +20,10 @@ jobs:
working-directory: go
- run: go test ./...
working-directory: go
- name: Static binary (CGO_ENABLED=0)
run: CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o /tmp/typeference ./cmd/typeference
- name: Static binaries (CGO_ENABLED=0)
run: |
CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o /tmp/typeference ./cmd/typeference
CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o /tmp/typeference-lsp ./cmd/typeference-lsp
working-directory: go
- name: Go binary reproduces committed reference output byte-for-byte
run: /tmp/typeference diff examples/helio --against dist --emit-ard --publisher-domain helio.example
Expand All @@ -56,31 +34,21 @@ jobs:
GOOS=js GOARCH=wasm go build ./cmd/typeference-wasm
go run ./cmd/playground-pack -root .. -out /tmp/examples.json
working-directory: go
# NOTE: BETH pack/score is intentionally NOT gating CI yet. The harness is
# unproven end to end (no real judged run has been collected), and an
# offline pack+score observes nothing — a green scorecard there would be
# vacuous (see ADR-0009 and score.go's judged-coverage requirement). Wire
# it back in once a real run is exercisable in CI or on the dev machine.

# Cross-implementation conformance: both compilers run the shared fixture
# corpus in conformance/; a digest mismatch on any fixture is a broken
# build. See conformance/README.md and ADR-0005.
conformance:
# Determinism suite: the Go compiler compiles the shared fixture corpus in
# conformance/ and must reproduce the committed digests. This is the
# single-implementation successor to the cross-implementation suite; the
# fixtures and canonicalization rulings (ADR-0004) are unchanged (ADR-0014).
determinism:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- uses: actions/setup-go@v5
with:
go-version: stable
cache-dependency-path: go/go.sum
- name: Conformance suite (Go implementation)
run: go test ./conformance -v
- run: go test ./conformance -v
working-directory: go
- name: Conformance suite (C# reference implementation)
run: dotnet test TypeFerence.slnx --filter FullyQualifiedName~ConformanceSuiteTests

# The repository-root AGENTS.md and dist-maintainer are build artifacts of
# agents/maintainer (the self-hosted maintainer definition). Drift between
Expand All @@ -98,3 +66,18 @@ jobs:
working-directory: go
- name: Root AGENTS.md is the compiled artifact
run: cmp AGENTS.md dist-maintainer/neutral/typeference-maintainer/AGENTS.md

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install -r tools/requirements-docs.txt
- run: python tools/render_whitepaper.py
- run: cp output/pdf/typeference-whitepaper.pdf /tmp/typeference-whitepaper-first.pdf
- run: python tools/render_whitepaper.py
- run: cmp /tmp/typeference-whitepaper-first.pdf output/pdf/typeference-whitepaper.pdf
- run: sudo apt-get update && sudo apt-get install -y poppler-utils
- run: pdfinfo output/pdf/typeference-whitepaper.pdf
8 changes: 2 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,16 @@ permissions:
contents: write

jobs:
# Nothing ships unless both implementations, the shared conformance suite,
# and the self-host drift gate are green at the tagged commit.
# Nothing ships unless the test suite, the determinism suite, and the
# self-host drift gate are green at the tagged commit.
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- uses: actions/setup-go@v5
with:
go-version: stable
cache-dependency-path: go/go.sum
- run: dotnet test TypeFerence.slnx
- run: go test ./...
working-directory: go
- name: Self-host drift gate
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ __pycache__/
web/playground/typeference.wasm
web/playground/wasm_exec.js
web/playground/examples.json

# Codex remote attachment scratch
.codex-remote-attachments/
go/typeference-wasm
*.wasm
106 changes: 102 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,123 @@ The agent that maintains the TypeFerence repository, defined in TypeFerence's ow
- Where the specification and an implementation disagree, the specification wins; record the ruling in docs/decisions and cover it with a conformance fixture.
- Every canonicalization or composition ruling ships with a fixture under conformance/fixtures in the same change.
- Never silently diverge from the specification; fixing the specification is allowed, silent divergence is not.
- Any change to code generation must keep the C# and Go implementations byte-identical, verified by the conformance suite before merge.
- Any change to code generation must reproduce the committed digests, verified by the determinism suite before merge.
- Never weaken determinism, provenance, or fail-closed behavior to make a change easier.
- A conformance digest is regenerated only together with the specification change and ADR that justify it; never hand-edit a digest.
- Repeated builds from identical source must stay byte-identical on every platform.
- The signature map always resides outside the source root; moving it inside creates a digest/signature cycle and is forbidden.
- signatureIntent.required fails closed; the unsigned-staging option exists solely to emit payloads for an external signer.
- TypeFerence imports externally produced signatures; it never signs, never verifies cryptographic validity, and never resolves keys.
- Trust metadata is declarative; never dereference identity, attestation, or provenance URIs during compilation.
- Every commit builds and passes both implementations' test suites and the shared conformance suite.
- Every commit builds and passes the test suite and the determinism suite.
- Decisions with real tradeoffs are recorded as ADRs in docs/decisions before the change merges.
- Documentation must be accurate against the code at the commit that includes it; no fabricated adoption, benchmarks, or endorsements.
- Commit messages are conventional and written for a critical human reader.

## Context slots

- `repositoryMap`: `context/repository-map.md`
- `repositoryMap`: `typeference/context/repository-map@0.1.0`

## Context

### Contribution Workflow

# Contribution workflow

- Work on feature branches; never rewrite published history; never tag or publish a
release outside the checklist in `docs/release-checklist.md`.
- Before any commit: `go test ./...` (from `go/`) and the determinism suite
(`make conformance`) both pass. A commit that breaks either does not land.
- Design decisions with real tradeoffs — spec semantics, canonical bytes, trust
model, dependencies — are recorded in `docs/decisions/` as numbered ADRs in the
same change.
- Generated artifacts (root `AGENTS.md`, `dist/`) are only ever changed by
regenerating them from source (`make selfhost`, `typeference build`); hand edits
to generated files are drift and CI rejects them.
- Documentation is accurate against the code at the commit that includes it. The
project describes itself as an experimental reference implementation; no invented
adoption, users, benchmarks, or endorsements, ever.

### Determinism Guarantees

# Determinism guarantees

Identical source must compile to identical bytes — across repeated builds and
across platforms. The guarantee is enforced, not aspirational:

- `conformance/fixtures/` records the expected `typeference-directory-v1` digest of
every emitted target for the fixture corpus; the compiler must reproduce them in
CI (a golden-file determinism suite).
- The committed `dist/` tree is the fully materialized reference output for
`examples/helio`; the compiler byte-compares against it in its tests.
- The committed root `AGENTS.md` and `dist-maintainer/` are build artifacts of
`agents/maintainer/`; CI recompiles the definition and fails on any drift.

Rules that protect the guarantee:

- Digest values are regenerated (`go test ./conformance -update`), never typed by
hand.
- Canonical serialization is defined in `docs/specification.md` ("Canonicalization");
any change to it is a specification change with an ADR.
- Nothing about determinism, provenance, or fail-closed behavior is ever relaxed to
make an unrelated change easier. If a change fights the determinism rules, the
change is wrong or the specification needs a recorded amendment.

### Repository Map

# Repository map

| Path | Role |
| --- | --- |
| `docs/specification.md` | Normative specification (source of truth). |
| `docs/whitepaper.md` | Motivation and design narrative. |
| `docs/decisions/` | Architecture decision records. |
| `go/` | The implementation (static binary; module `github.com/buchk/TypeFerence/go`). |
| `go/cmd/typeference-lsp/` | Language server for `.tfer`/`.yaml` authoring. |
| `editors/vscode/` | VS Code client for the language server. |
| `go/conformance/` | Determinism runner (`-update` regenerates digests). |
| `conformance/` | Golden-file fixture corpus. |
| `examples/helio` | Example organization used by tests and the quick start. |
| `dist/` | Committed reference output of `examples/helio` (byte-compared in CI). |
| `agents/maintainer/` | This definition; compiled into the root `AGENTS.md` and `dist-maintainer/`. |
| `.github/workflows/ci.yml` | Build, test, determinism, and self-host drift gates. |

The root `AGENTS.md` is generated from this definition. To change it, edit the
resources under `agents/maintainer/` and run `make selfhost`; never edit the
generated file directly.

### Specification-first Workflow

# Specification-first workflow

The normative specification is `docs/specification.md` at the repository root. It is
the source of truth; the Go implementation under `go/` is its reference realization.

A semantic change alters valid source, composition, or compiled bytes. It follows:

1. Amend `docs/specification.md`.
2. Record the decision and rejected alternatives in `docs/decisions/`.
3. Add or update `conformance/fixtures/`.
4. Update the implementation until determinism passes.

If implementation and specification disagree, the specification wins. Ambiguity is
a specification bug, not permission for a private implementation rule.

### Trust Model

# Trust model invariants

- The signature map lives outside the source root, avoiding a digest/signature cycle.
- `signatureIntent.required` fails closed; unsigned staging only emits payloads for
an external signer.
- TypeFerence imports externally produced signatures; it never signs, verifies
cryptographic validity, resolves keys, or dereferences trust URIs.
- Identities are ASCII; internationalized authorities use punycode.

Trust changes require a specification amendment, ADR, and conformance fixtures.

## Available skills

- `typeference-maintainer.audit-drift`: Confirms the committed AGENTS.md and maintainer bundle are exact build artifacts of this definition.
- `typeference-maintainer.verify-conformance`: Runs the shared conformance suite on both implementations and reports any digest disagreement.
- `typeference-maintainer.verify-conformance`: Runs the determinism suite and reports whether the compiler reproduces the committed digests.

40 changes: 39 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,50 @@
All notable changes to TypeFerence are documented here. The format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow semantic
versioning. Tool versions (this file) are independent of the typed-resource
`schemaVersion` (currently 3) and the trust configuration `schemaVersion`
`schemaVersion` (currently 4) and the trust configuration `schemaVersion`
(currently 1), which only change when the source formats change incompatibly.

TypeFerence is an experimental reference implementation; pre-1.0 versions make no
compatibility promises between minor versions.

## [Unreleased]

### Changed

- **Closed v4 source language** ([ADR-0020](docs/decisions/0020-close-the-source-language.md)).
Native context types replace embedded JSON Schema, context values and typed
slots are complete compile-time values, `contextFiles` is removed, mode
requirements remain conditional, sealed abstract requirements fail, and
normal product entrypoints reject legacy v3 input.
- **Build/link separation and source identity**
([ADR-0022](docs/decisions/0022-build-link-and-source-identity.md)). Build emits
deterministic unlinked targets and integrity indexes; explicit deployment
files bind tools, modes, commands, environment references, and endpoints.
Linked Codex MCP configuration and neutral A2A cards are structurally
serialized without changing source or unlinked-target identity.
- **Go-only implementation** ([ADR-0014](docs/decisions/0014-go-only-implementation.md)).
The C# reference implementation was retired; the Go implementation is now the
sole implementation. The specification stays normative in principle. The
cross-implementation conformance suite becomes a single-implementation
golden-file determinism suite over the same fixtures — the determinism
guarantee is unchanged.

### Added

- **Locked source packages and enterprise restore**
([ADR-0021](docs/decisions/0021-restore-locked-source-packages.md)):
`pack`, `restore`, and `update`, canonical `.tferpkg` archives and lockfiles,
complete offline dependency materialization, scoped filesystem/HTTP/JFrog/
Azure Artifacts routes, and dependency provenance in target artifacts.
- **`.tfer` source format** and object-model constructs (ADRs 0012–0019):
invocation-mode skill variants, user-defined typed context (`contextType`
refinement, context held by id, `requiresContextTypes`), tools as extern
declarations (`requiresTools`), capability exposure/visibility, and sealing
(`sealed`/`required` bindings). All additive and opt-in.
- **Language server** (`typeference-lsp`): authoring and composition
diagnostics, completion, go-to-definition, and document symbols for `.tfer`
and `.yaml` sources.

## [0.0.4] - 2026-07-15

### Added
Expand Down
11 changes: 0 additions & 11 deletions Directory.Build.props

This file was deleted.

27 changes: 11 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,41 +1,37 @@
# TypeFerence build entry points. Requires: Go 1.24+, .NET 10 SDK (reference
# implementation only). All artifacts are deterministic; run `make conformance`
# to verify both implementations agree byte-for-byte.
# TypeFerence build entry points. Requires: Go 1.24+ and nothing else. All
# artifacts are deterministic; run `make conformance` to verify the compiler
# reproduces the committed digests byte-for-byte (ADR-0014).

GO ?= go
DOTNET ?= dotnet
VERSION ?= dev
GOFLAGS := -trimpath
LDFLAGS := -s -w -X main.version=$(VERSION)
BINDIR := bin

.PHONY: all build build-go build-dotnet test test-go test-dotnet conformance \
.PHONY: all build build-go build-lsp test test-go conformance \
selfhost selfhost-check fmt vet clean release-binaries playground

all: build test

build: build-go build-dotnet
build: build-go build-lsp

# Single static binary, no runtime dependencies.
build-go:
cd go && CGO_ENABLED=0 $(GO) build $(GOFLAGS) -ldflags "$(LDFLAGS)" -o ../$(BINDIR)/typeference$(shell $(GO) env GOEXE) ./cmd/typeference

build-dotnet:
$(DOTNET) build TypeFerence.slnx
# Language server for .tfer/.yaml authoring diagnostics (internal/lsp).
build-lsp:
cd go && CGO_ENABLED=0 $(GO) build $(GOFLAGS) -ldflags "$(LDFLAGS)" -o ../$(BINDIR)/typeference-lsp$(shell $(GO) env GOEXE) ./cmd/typeference-lsp

test: test-go test-dotnet
test: test-go

test-go:
cd go && $(GO) test ./...

test-dotnet:
$(DOTNET) test TypeFerence.slnx

# Cross-implementation conformance: both compilers run the shared fixture
# corpus; digests must match the manifests and each other.
# Determinism suite: the compiler compiles the shared fixture corpus and must
# reproduce the committed digests (ADR-0014).
conformance:
cd go && $(GO) test ./conformance -run TestConformance -v
$(DOTNET) test TypeFerence.slnx --filter FullyQualifiedName~ConformanceSuiteTests

# Recompile the self-hosted maintainer definition (agents/maintainer) into its
# committed artifacts: dist-maintainer and the repository-root AGENTS.md.
Expand All @@ -50,7 +46,6 @@ selfhost-check: build-go

fmt:
cd go && gofmt -l -w .
$(DOTNET) format TypeFerence.slnx

vet:
cd go && $(GO) vet ./...
Expand Down
Loading
Loading