Commit a2d34a5
feat(verify): output-tag preservation (@requiredTags) + render maxChars budget [FR-004]
First slice of the prompt-pillar verify extensions. Adds a cross-language,
conformance-gated static check that a template's text (body + provider-resolved
partials) contains each declared output tag as both an opening `<tag` (prefix,
attributes allowed) and a closing `</tag>`. A miss yields the new stable code
ERR_OUTPUT_TAG_MISSING (path = tag name). Reference-first: TS defines behavior
via the shared fixtures/verify-conformance corpus; C# and Python match it.
Contract decisions, pinned in fixtures:
- open tag = `<tag` followed by `>` or XML whitespace (space/tab/CR/LF) — so
`<answer foo="1">` counts but `<answers>` does not over-match `answer`;
- close tag = exact literal `</tag>`; self-closing `<tag/>` never satisfies;
- tag text is sourced from the body + partials resolved during the single
existing verify walk (no double resolution).
Also: render() gains an optional maxChars budget (runtime-only throw; rendered
length is data-dependent, so NOT conformance-scoped). @maxtokens stays out of
scope. New @requiredTags template attr (string[]) on template.prompt AND
template.output, wired through `meta verify` (TS + C#). Java deferred (no verify
tier yet).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 73b9f3a commit a2d34a5
50 files changed
Lines changed: 636 additions & 34 deletions
File tree
- fixtures
- conformance
- verify-conformance
- verify-required-tag-in-partial
- partials
- verify-required-tag-missing-close
- verify-required-tag-missing-open
- verify-required-tag-prefix-no-overmatch
- verify-required-tag-self-closing
- verify-required-tags-present
- server
- csharp
- MetaObjects.Cli.Tests
- MetaObjects.Cli
- MetaObjects.Render.Tests
- MetaObjects.Render
- MetaObjects/Template
- python
- src/metaobjects
- render
- tests/render
- typescript/packages
- cli
- src/commands
- test/integration
- metadata
- src
- template
- test
- render
- src
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments