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
23 changes: 23 additions & 0 deletions .github/workflows/prompt-sdk-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Prompt SDK conformance
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
node: [22, 24]
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- run: npm test
19 changes: 19 additions & 0 deletions CONSTITUTION_CONFORMANCE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Constitution conformance record

## Issue #71 assessment — 2026-09-11

Scope: reusable offline adapter conformance suite; text, structured and context
reference prompts; deterministic integration goldens and failure cases; CI
matrix and coverage documentation. Builds on the merged issue #70 baseline.
Constitution v1.0.0 at `a9cc8a503aa30e17820edc62ac95f7cbe10e0564`
remains the authority. Accountable owner: @andrewperis; status: Conforming
candidate pending owner review and merge.

Evidence: 100 passing local tests, including 12 common adapter cases across two
implementations and five end-to-end reference cases. Goldens use fixed clocks
and synthetic inputs; non-public context bodies and identities are excluded.
CI configuration uses immutable action pins, read-only permissions and no
provider secrets. No new contracts, dependencies or constitutional exceptions.
Optional live-provider mappings, unsupported image/multimodal execution and
immutable publication (#72) are outside scope. Existing dependency advisories
remain separate. Review before release or any fixture/privacy/adapter boundary
change. The CI matrix must also pass remotely before merge.

## Issue #70 assessment — 2026-09-11

Scope: CLI inspection, explicit fixture rendering, mock/trusted-module execution,
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Production software for the Definitely Secure Studio creative toolchain.

The [reference prompt library](examples/reference-prompts/README.md) demonstrates
offline end-to-end v1 flows with reviewed golden fixtures.

Use the [Prompt CLI](docs/prompt-cli.md) to validate, inspect, render, execute
synthetic tests and validate structured outputs.

Expand Down
47 changes: 47 additions & 0 deletions examples/reference-prompts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Prompt SDK v1 reference library

All prompts, inputs, outputs and context are synthetic and publishable. The
internal classification in the context example exercises policy; it is not
private production material. No real credentials or remote providers are used.

```sh
npm ci
node examples/reference-prompts/run.mjs text
node examples/reference-prompts/run.mjs structured
node examples/reference-prompts/run.mjs context
npm test
```

- `text.prompt.json`: typed inputs, explicit defaults, optional context, text
execution, validation evidence and public provenance.
- `structured.prompt.json`: independent json-schema validation against the
existing synthetic reference-facts schema, raw/normalized identities and
a second provenance revision for processing evidence.
- `context.prompt.json`: prepared package and explicit authorization, required
text/JSON context slots, classification propagation and metadata redaction.

The runner uses shared synthetic inputs and request settings from
`../cli/`. The context clock is explicitly 2026-08-20; execution uses a fixed
epoch clock. This keeps historical fixtures reproducible without weakening
expiry enforcement (a separate negative test uses an expired timestamp).

The reference-facts artifact URI, release tag and all-2 commit are deliberately
synthetic identity metadata, not a claim of an immutable published contract.
The runner supplies verified schema bytes locally; it never downloads that URI.
Actual immutable contract release remains gated on Studio #72.

Prompt SDK v1 supports text messages and JSON output here. It has no supported
image/multimodal execution contract; these fixtures do not pretend otherwise.

## Golden review

`tests/fixtures/golden/` stores the complete public render result, structured
result when applicable, and observer records. Non-public context render/output
bodies are omitted. Golden comparisons do not mask hashes, ids, defaults or
timestamps. Every observer/structured document is independently validated too.

To inspect a proposed change, run the corresponding runner and compare its JSON
with the committed golden. Update a golden only after reviewing the contract,
canonicalization, redaction and intended behavior change; do not regenerate
snapshots just to make a failing test pass. The test command never writes goldens.
Check fixture safety before committing any updated content.
25 changes: 25 additions & 0 deletions examples/reference-prompts/context-authorization.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"spec_version": "1.0.0",
"kind": "context-authorization",
"decision_id": "context_auth_reference_0001",
"decision": "allow",
"package": {
"id": "context-package.reference.synthetic",
"version": "1.0.0",
"instance_id": "ctxpkg_reference_0001"
},
"prompt": {
"id": "prompt.reference.context-package",
"version": "1.0.0"
},
"sections": [
"approved_notes",
"context_facts"
],
"max_classification": "internal",
"purpose": "Render synthetic approved context for issue #67 integration testing.",
"decided_by": "@andrewperis",
"decided_at": "2026-08-20T00:00:00Z",
"expires_at": "2026-08-21T00:00:00Z",
"authority_reference": "https://github.com/DefinitelySecureStudio/studio/issues/67"
}
72 changes: 72 additions & 0 deletions examples/reference-prompts/context-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"spec_version": "1.0.0",
"kind": "context-package",
"manifest": {
"package": {
"id": "context-package.reference.synthetic",
"version": "1.0.0",
"instance_id": "ctxpkg_reference_0001"
},
"builder": {
"id": "studio.mock.context-builder",
"version": "1.0.0"
},
"created_at": "2026-08-20T00:00:00Z",
"review_after": "2026-08-21T00:00:00Z",
"expires_at": "2026-08-22T00:00:00Z",
"purpose": "Render synthetic approved context for issue #67 integration testing.",
"authority_reference": "https://github.com/DefinitelySecureStudio/studio/issues/67",
"classification": "internal",
"total_content_bytes": 57,
"sources": [
{
"source_id": "source.synthetic.public",
"kind": "synthetic",
"version": "1.0.0",
"classification": "public",
"evidence_reference": "https://github.com/DefinitelySecureStudio/studio/issues/67"
},
{
"source_id": "source.synthetic.internal",
"kind": "synthetic",
"version": "1.0.0",
"classification": "internal",
"evidence_reference": "https://github.com/DefinitelySecureStudio/studio/issues/67"
}
],
"sections": [
{
"slot": "approved_notes",
"classification": "public",
"media_type": "text/plain",
"content": "Synthetic approved note.",
"byte_size": 24,
"sha256": "sha256:c847bf684b5aabe0ea2d290978d299a6060a8132a01bd03fd606d6bdbb465384",
"source_ids": [
"source.synthetic.public"
]
},
{
"slot": "context_facts",
"classification": "internal",
"media_type": "application/json",
"content": {
"count": 1,
"facts": [
"synthetic"
]
},
"byte_size": 33,
"sha256": "sha256:086a926808322e2c933c498209d220850d84c1366dc967ddd502417d1f33560f",
"source_ids": [
"source.synthetic.internal"
]
}
]
},
"manifest_identity": {
"canonicalization": "studio-json-v1",
"byte_size": 1427,
"sha256": "sha256:1c5b3e293a37898c045c4830c116545f52d38e87e40220b1733637b2ef734c2b"
}
}
160 changes: 160 additions & 0 deletions examples/reference-prompts/context.prompt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{
"spec_version": "1.0.0",
"id": "prompt.reference.context-package",
"version": "1.0.0",
"name": "Describe a public item",
"description": "Synthetic renderer fixture for an explicitly supplied public item.",
"purpose": "Exercise provider-neutral rendering; it does not retrieve data, approve output, or establish Canon.",
"owners": [
"@andrewperis"
],
"lifecycle": {
"status": "draft"
},
"inputs": [
{
"name": "item",
"description": "Synthetic public item name.",
"type": "string",
"required": true,
"classification": "public",
"constraints": {
"min_length": 1
}
},
{
"name": "attributes",
"description": "Synthetic attributes.",
"type": "object",
"required": true,
"classification": "public"
},
{
"name": "concise",
"description": "Request concise output.",
"type": "boolean",
"required": false,
"classification": "public",
"default": true
}
],
"context_slots": [
{
"name": "approved_notes",
"description": "Explicit synthetic notes.",
"required": true,
"accepted_classifications": [
"public",
"internal"
],
"accepted_media_types": [
"text/plain"
],
"max_bytes": 100
},
{
"name": "context_facts",
"description": "Synthetic facts",
"required": true,
"accepted_classifications": [
"internal"
],
"accepted_media_types": [
"application/json"
],
"max_bytes": 100
}
],
"template": {
"format": "studio-messages-v1",
"messages": [
{
"role": "instruction",
"parts": [
{
"type": "text",
"text": "Describe only the supplied synthetic item."
}
]
},
{
"role": "user",
"parts": [
{
"type": "text",
"text": "Item: "
},
{
"type": "input",
"name": "item"
},
{
"type": "text",
"text": "\nAttributes: "
},
{
"type": "input",
"name": "attributes",
"format": "json"
},
{
"type": "text",
"text": "\nConcise: "
},
{
"type": "input",
"name": "concise",
"format": "text"
},
{
"type": "text",
"text": "\nNotes: "
},
{
"type": "context",
"slot": "approved_notes"
},
{
"type": "context",
"slot": "context_facts",
"format": "json"
}
]
}
]
},
"capabilities": {
"required": [
"text-generation"
],
"optional": []
},
"output": {
"kind": "text",
"media_type": "text/plain",
"description": "A synthetic plain-text description for human review."
},
"provenance": {
"origin": "studio-original",
"created_by": "@andrewperis",
"created_at": "2026-08-17T00:00:00Z",
"source_references": [],
"rights": {
"basis": "studio-original",
"reviewed_by": "@andrewperis",
"reviewed_at": "2026-08-17T00:00:00Z",
"notices": []
}
},
"governance": {
"constitution": {
"version": "1.0.0",
"tag": "constitution/v1.0.0",
"commit": "a9cc8a503aa30e17820edc62ac95f7cbe10e0564"
},
"decision_owner": "@andrewperis",
"evidence": [
"https://github.com/DefinitelySecureStudio/studio/issues/71"
]
}
}
Loading
Loading