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
4 changes: 2 additions & 2 deletions contract/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ root is not.
| `chat-context-snapshot.json` | Complete portable chat state, ordered JSON sources, aliases and active turns (#160) | closed | | `context/chat.ts`, `go/context/chat_snapshot.go` |
| `history-chunk.json` | Resource-scoped content-addressed retained object chunks | closed | | `history/codec.ts`, `go/context/history_codec.go` |
| `history-entry.json` | Storage-observed commit history with sequence/time and exact context binding | closed | | `storage/history.ts`, `go/context/history_store.go` |
| `dialect-authoring.json` | Exact read and complete replacement review-only tool inputs (#171) | open | `$defs/conversion`, `$defs/read`, `$defs/fact`, `$defs/evidence`, `$defs/propose` | `packages/harness/dialects.ts`, `go/context/dialects.go` |
| `dialect-draft.json` | Bounded editable draft checkpoints, exact stage receipts, and final review lineage (#171) | open | `$defs/conversion`, `$defs/fact`, `$defs/evidence`, `$defs/sample`, `$defs/research`, `$defs/column`, `$defs/candidate`, `$defs/result`, `$defs/failure`, `$defs/check`, `$defs/checkpoint`, `$defs/ack`, `$defs/lineage`, `$defs/originalField`, `$defs/originalRevision`, `$defs/conversionContract`, `$defs/retainedRead` | `packages/harness/dialects.ts`, `go/context/dialects.go` |
| `dialect-authoring.json` | Exact read and complete replacement review-only tool inputs (#171); the paged read of original declarations and the read port's page request and page, bound to the collection revision and inventory digest (#243) | open | `$defs/conversion`, `$defs/read`, `$defs/fact`, `$defs/evidence`, `$defs/propose`, `$defs/pageRequest`, `$defs/declaration`, `$defs/page` | `packages/harness/dialects.ts`, `go/context/dialects.go` |
| `dialect-draft.json` | Bounded editable draft checkpoints, exact stage receipts, and final review lineage (#171); version 2 carries the complete original inventory by digest (`researchIndex`), version 1 keeps v0.11.0's inline `researchDeclarations` (#243) | open | `$defs/conversion`, `$defs/fact`, `$defs/evidence`, `$defs/sample`, `$defs/research`, `$defs/column`, `$defs/candidate`, `$defs/result`, `$defs/failure`, `$defs/check`, `$defs/checkpoint`, `$defs/ack`, `$defs/lineage`, `$defs/originalField`, `$defs/originalRevision`, `$defs/conversionContract`, `$defs/retainedRead`, `$defs/indexField`, `$defs/indexRevision`, `$defs/researchIndex` | `packages/harness/dialects.ts`, `go/context/dialects.go` |
| `run-report.json` | Pure projection of recorded execution state and optional validated event prefix (#157) | closed | the root and all report sections | `packages/harness/runReport.ts`; `go/context/run_report.go` |
| `run-report-v2.json` | Feature checkpoint3 projection with attributable usage subtotals and completeness (#170) | closed | `$defs/total`, `$defs/totals` | `packages/harness/runReport.ts`; `go/context/run_report.go` |
| `usage-budget.json` | Root-owned bounded shared-budget reservations, refusals and reported facts (#170); receipts grant no dispatch authority | closed | `$defs/amounts`, `$defs/scope`, `$defs/reservation`, `$defs/receipt`, `$defs/entry`, `$defs/refusal` | `packages/harness/storage/usageJournal.ts`; `go/context/usage_budget_journal.go` |
Expand Down
118 changes: 116 additions & 2 deletions contract/schemas/dialect-authoring.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/Judgment-Pack/judgment-pack-agent/blob/main/contract/schemas/dialect-authoring.json",
"title": "Certified dialect authoring tool inputs",
"description": "First-party read and review-only complete replacement proposal inputs. Hashes bind exact prior read bytes; none is a save, publication, execution or preparation approval. Proposals require a trusted host opt-in to the package-pinned experimental retained-column document contract; model arguments cannot select it.",
"title": "Certified dialect authoring tool inputs and the paged declaration read",
"description": "First-party read and review-only complete replacement proposal inputs. Hashes bind exact prior read bytes; none is a save, publication, execution or preparation approval. Proposals require a trusted host opt-in to the package-pinned experimental retained-column document contract; model arguments cannot select it. A read with cursor returns one page of original field declarations. The read port's paged exchange (pageRequest, page) carries original declarations by position in the inventory index, bound to the exact collection revision and inventory digest; the factory checks every declaration against its indexed SHA-256 digest (#243).",
"oneOf": [
{
"$ref": "#/$defs/read"
},
{
"$ref": "#/$defs/propose"
},
{
"$ref": "#/$defs/pageRequest"
},
{
"$ref": "#/$defs/page"
}
],
"$defs": {
Expand Down Expand Up @@ -100,6 +106,11 @@
},
"packKey": {
"$ref": "#/$defs/opaque"
},
"cursor": {
"type": "integer",
"minimum": 0,
"maximum": 1000000
}
}
},
Expand Down Expand Up @@ -201,6 +212,109 @@
"maxLength": 4000
}
}
},
"pageRequest": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"packKey",
"revision",
"inventoryDigest",
"cursor",
"limit"
],
"properties": {
"id": {
"$ref": "#/$defs/opaque"
},
"packKey": {
"$ref": "#/$defs/opaque"
},
"revision": {
"type": "string",
"minLength": 1,
"maxLength": 128
},
"inventoryDigest": {
"$ref": "#/$defs/digest"
},
"cursor": {
"type": "integer",
"minimum": 0,
"maximum": 1000000
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 1000
}
}
},
"declaration": {
"type": "object",
"additionalProperties": false,
"required": [
"revision",
"name",
"fieldJson"
],
"properties": {
"revision": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"fieldJson": {
"type": "string",
"maxLength": 16384
}
}
},
"page": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"packKey",
"revision",
"inventoryDigest",
"cursor",
"declarations"
],
"properties": {
"id": {
"$ref": "#/$defs/opaque"
},
"packKey": {
"$ref": "#/$defs/opaque"
},
"revision": {
"type": "string",
"minLength": 1,
"maxLength": 128
},
"inventoryDigest": {
"$ref": "#/$defs/digest"
},
"cursor": {
"type": "integer",
"minimum": 0,
"maximum": 1000000
},
"declarations": {
"type": "array",
"maxItems": 1000,
"items": {
"$ref": "#/$defs/declaration"
}
}
}
}
}
}
120 changes: 118 additions & 2 deletions contract/schemas/dialect-draft.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Dialect draft checkpoint, acknowledgment and final lineage",
"description": "Portable host retention only. Byte ceilings, exact content/digest/receipt chains, stage order and authority limits are additionally enforced by the tool factory. A draft permits inspection and editing, never saving or execution. New factories retain conversionContract and complete researchDeclarations (null means unavailable); older version-1 checkpoints remain inspectable and grant no new contract support.",
"description": "Portable host retention only. Byte ceilings, exact content/digest/receipt chains, stage order and authority limits are additionally enforced by the tool factory. A draft permits inspection and editing, never saving or execution. Version-2 checkpoints (#243) carry the complete original inventory by digest as researchIndex (null means unavailable) and never researchDeclarations; version-1 checkpoints written by v0.11.0 keep their inline researchDeclarations, never carry researchIndex, remain inspectable and grant no new contract support.",
"oneOf": [
{
"$ref": "#/$defs/checkpoint"
Expand Down Expand Up @@ -264,6 +264,16 @@
"$ref": "#/$defs/retainedRead"
}
]
},
"researchIndex": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/researchIndex"
}
]
}
}
},
Expand Down Expand Up @@ -341,7 +351,10 @@
],
"properties": {
"version": {
"const": 1
"enum": [
1,
2
]
},
"attemptId": {
"type": "string",
Expand Down Expand Up @@ -408,6 +421,40 @@
}
}
}
},
{
"if": {
"properties": {
"version": {
"const": 2
}
}
},
"then": {
"properties": {
"candidate": {
"required": [
"researchIndex"
],
"not": {
"required": [
"researchDeclarations"
]
}
}
}
},
"else": {
"properties": {
"candidate": {
"not": {
"required": [
"researchIndex"
]
}
}
}
}
}
]
},
Expand Down Expand Up @@ -658,6 +705,75 @@
]
}
}
},
"indexField": {
"type": "object",
"additionalProperties": false,
"required": [
"name",
"digest"
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"digest": {
"type": "string",
"pattern": "^sha256:[0-9a-f]{64}$"
}
}
},
"indexRevision": {
"type": "object",
"additionalProperties": false,
"required": [
"revision",
"fields"
],
"properties": {
"revision": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"fields": {
"oneOf": [
{
"type": "null"
},
{
"type": "array",
"maxItems": 1000,
"items": {
"$ref": "#/$defs/indexField"
}
}
]
}
}
},
"researchIndex": {
"type": "object",
"additionalProperties": false,
"required": [
"digest",
"revisions"
],
"properties": {
"digest": {
"type": "string",
"pattern": "^sha256:[0-9a-f]{64}$"
},
"revisions": {
"type": "array",
"maxItems": 1000,
"items": {
"$ref": "#/$defs/indexRevision"
}
}
}
}
},
"$id": "https://github.com/Judgment-Pack/judgment-pack-agent/blob/main/contract/schemas/dialect-draft.json"
Expand Down
2 changes: 1 addition & 1 deletion contract/testdata/dialect-authoring/authoring.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
],
"summary": "Map structured amount and explicit evidence availability."
},
"expectedFingerprint": "sha256:742bf232b81d407107f749e5ca71c9ada909e5ba428c7cb4a5c603243983bf8e",
"expectedFingerprint": "sha256:93d69bd81057f54b38ce282c3212c5c895778c27782e83db0e160855cd9c5ba9",
"expectedMappingDigest": "sha256:ceb61c4b35b5c6895c13d0b723cc096dc39d723014677f3e8237ea4e31c8e203",
"expectedDocument": "{\"case\":{\"evidence\":[{\"availability\":{\"column\":\"availability\",\"contractVersion\":\"1\"},\"requirement\":\"receipt\",\"source\":\"/retained\"}],\"facts\":[{\"conversion\":{\"column\":\"amount/raw~value\",\"contractVersion\":\"1\",\"kind\":\"decimal\"},\"source\":\"/retained\",\"target\":\"/amount\"}]},\"evidence\":null,\"facts\":null,\"provider\":\"\",\"unmapped\":[],\"unmappedEvidence\":[],\"version\":2}",
"conversions": [
Expand Down
29 changes: 28 additions & 1 deletion contract/vectors/dialect-authoring/inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,36 @@
],
"evidence": [],
"summary": "Retain the original declared research value."
},
{
"id": "collection:opaque/one",
"packKey": "declared:pack",
"cursor": 0
},
{
"id": "collection:opaque/one",
"packKey": "declared:pack",
"revision": "revision:one",
"inventoryDigest": "sha256:81d5612257c81e44325b31ef0ba247a626810f956e6261e75c22114c4c3fb5d6",
"cursor": 0,
"limit": 1
},
{
"id": "collection:opaque/one",
"packKey": "declared:pack",
"revision": "revision:one",
"inventoryDigest": "sha256:81d5612257c81e44325b31ef0ba247a626810f956e6261e75c22114c4c3fb5d6",
"cursor": 0,
"declarations": [
{
"revision": "original-recipe:one",
"name": "typed",
"fieldJson": "{\"name\":\"typed\",\"type\":\"boolean\",\"required\":false,\"description\":\"A retained typed field.\"}"
}
]
}
],
"description": "Handwritten exact read and complete replacement tool input witnesses.",
"description": "Handwritten exact read, paged read and complete replacement tool input witnesses, with the read port's page request and page for the fixture inventory (#243).",
"source": {
"harness": {
"repository": "Judgment-Pack/judgment-pack-agent",
Expand Down
Loading
Loading