Skip to content

fix: derive slots with validate.Slots so {{ and }} are literal braces - #35

Merged
sujal-maheshwari2004 merged 1 commit into
mainfrom
fix/slots-brace-escapes
Nov 15, 2026
Merged

sujal-maheshwari2004 merged 1 commit into
mainfrom
fix/slots-brace-escapes

Conversation

@sujal-maheshwari2004

Copy link
Copy Markdown
Member

Follow-up to priompt/proto#19, released in proto v0.7.3.

Templates may now contain literal braces written {{ and }}, exactly as in Python's str.format. deriveSlots used its own \{(\w+)\} regexp, which reads {{name}} as slot name, so validation would reject the publish with declared slots never used.

Change

  • Requires github.com/priompt/proto v0.7.3.
  • deriveSlots calls validate.Slots, the same rules the server validates against.
  • Drops the now-unused regexp.

Tested

  • TestDeriveSlots adds a case: Answer {question}. Reply as JSON: {{"answer": "{{name}}"}} gives [question].
  • End to end against a priompt server built with proto v0.7.3: promptctl publish of that JSON-example prompt prints published priompt://acme/json (536901c63ad8), the same hash as priompt put.
  • go vet ./... and go test ./... pass.

proto v0.7.3 lets templates write literal braces as {{ and }}, exactly as in
Python's str.format. deriveSlots used its own \{(\w+)\} regexp, which reads
"{{name}}" as slot "name"; validate then rejected the publish with
"declared slots never used". Require proto v0.7.3 and derive slots with
validate.Slots, the same rules the server validates against.
@sujal-maheshwari2004
sujal-maheshwari2004 merged commit 8f07899 into main Nov 15, 2026
1 check passed
@sujal-maheshwari2004
sujal-maheshwari2004 deleted the fix/slots-brace-escapes branch November 15, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant