Skip to content

Commit ff093d9

Browse files
committed
Add PROSE adapter layer (v0.2.0): constructors, renderers, body sections
- Move prose.typ to src/adapters/prose.typ (filesystem boundary visible) - Add p-agent, p-instruction, p-skill, p-workflow constructors - Add render-agent, render-instruction, render-skill, render-workflow - Extend p-instruction sections: body (raw Markdown) as alternative to items - Promote md-table, md-row, escape-pipes to public API - Add PROSE ingest support (agent, instruction, skill, workflow TOML keys) - Add test-prose.typ with 8 test groups + TOML fixtures - Update Boundary.md with adapter layer documentation
1 parent 7a9d0b6 commit ff093d9

11 files changed

Lines changed: 904 additions & 16 deletions

File tree

Boundary.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ rules apply to consumers building layers on top of this package.
2727
│ lib.typ → src/primitives.typ │
2828
│ → src/render.typ │
2929
│ → src/validate.typ │
30+
│ → src/adapters/prose.typ │
3031
└─────────────────────────────────────┘
3132
```
3233

@@ -122,9 +123,47 @@ must use its own tagging convention in a separate namespace.
122123

123124
---
124125

126+
## Markdown Utilities (promoted in v0.2.0)
127+
128+
Previously internal `_md-*` helpers, now public for use by adapter layers
129+
and consumers building custom renderers.
130+
131+
| Symbol | Input | Returns |
132+
|--------|-------|---------|
133+
| `md-table` | `headers`, `rows` | Markdown table string |
134+
| `md-row` | `cells` | Single Markdown table row string |
135+
| `escape-pipes` | `string` | String with `\|` escaped |
136+
137+
These are stable utilities. Their signatures are fixed from v0.2.0.
138+
139+
---
140+
141+
## Adapter Layer (Phase 3, evolving)
142+
143+
PROSE primitive constructors and renderers. These are NOT under the
144+
immutable 10-symbol contract. Signatures may change between minor versions.
145+
146+
| Symbol | Type | Stable |
147+
|--------|------|--------|
148+
| `p-agent` | constructor | no (adapter, evolving) |
149+
| `p-instruction` | constructor | no (adapter, evolving) |
150+
| `p-skill` | constructor | no (adapter, evolving) |
151+
| `p-workflow` | constructor | no (adapter, evolving) |
152+
| `render-agent` | renderer | no (adapter, evolving) |
153+
| `render-instruction` | renderer | no (adapter, evolving) |
154+
| `render-skill` | renderer | no (adapter, evolving) |
155+
| `render-workflow` | renderer | no (adapter, evolving) |
156+
157+
Adapter-layer dictionaries carry `_type` tags (`"agent"`, `"instruction"`,
158+
`"skill"`, `"workflow"`). The same `_type` rules apply: consumers must not
159+
read or branch on `_type` — that is the render layer's responsibility.
160+
161+
---
162+
125163
## Versioning Rule
126164

127165
The public API (10 symbols, their signatures, and their Markdown output
128166
contract) is stable within a major version. Any change to the Markdown
129167
output format — even whitespace — is a breaking change and requires a
130168
major version bump. The internal symbols carry no versioning guarantee.
169+
Adapter layer symbols follow semver but are not under the immutable contract.

lib.typ

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,20 @@
3333
// field builds a schema field dict
3434
// entry builds a context entry dict
3535
// checkpoint shorthand for p-checkpoint (positional args)
36+
//
37+
// Markdown utilities (promoted from internal in v0.2.0):
38+
// md-table headers, rows → Markdown table string
39+
// md-row cells → single Markdown table row
40+
// escape-pipes string → string with | escaped
41+
//
42+
// PROSE adapter layer (Phase 3, evolving — NOT under 10-symbol contract):
43+
// p-agent, p-instruction, p-skill, p-workflow constructors
44+
// render-agent, render-instruction, render-skill, render-workflow renderers
3645

3746
#import "src/primitives.typ": p-context, p-schema, p-checkpoint, p-chat-mode, p-prompt
3847
#import "src/render.typ": render-context, render-schema, render-checkpoint, render-chat-mode, render-prompt
48+
#import "src/render.typ": md-table, md-row, escape-pipes
49+
#import "src/adapters/prose.typ": p-agent, p-instruction, p-skill, p-workflow
50+
#import "src/adapters/prose.typ": render-agent, render-instruction, render-skill, render-workflow
3951
#import "src/ingest.typ": from-toml, from-yaml
4052
#import "src/helpers.typ": ctx, schema, field, entry, checkpoint

0 commit comments

Comments
 (0)