fix(harvest): --prompt-only prints the contract with no other input - #249
Merged
Conversation
When invoked without --transcript or --diff, the command now emits the static contract (rules, vocabulary, output format) with placeholder text for the TRANSCRIPT and DIFF sections that says '(provided at harvest time)'. Previously it refused with a skip message, which inverted the order of use: the contract is what a session needs before it has produced a transcript. The exit code remains 0, which is now correct: the command succeeded and produced the requested output on stdout. A caller distinguishes success from the old silent skip by checking stdout content. Fixes #229 Record-Id: r-lb0xl89a Ruled-out: parameterising the contract with empty strings | prints a template with empty holes that teaches the session nothing about placeholder handling Limit: the static contract uses explicit placeholder text for TRANSCRIPT and DIFF rather than omitting those sections, because the prompt text references them by name
CommitLore — record lintTrailers: clean — 1 commit in Active constraints for the paths this PR touchesLimits (54)
Ruled out (98)
Warnings (41)
Trailer violations fail this check. Active constraints are informational — they are what the repository already decided, not a verdict on this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--prompt-onlyno longer requires--transcriptand--diffto print the contract. When invoked bare, it emits the static contract (rules, vocabulary, output format) with explicit placeholder text for TRANSCRIPT/DIFF sections.What was wrong
The command refused to print the contract unless both
--transcriptand--diffwere supplied, printing a skip message and exiting 0. This inverted the order of use: the contract is what a session needs before it has produced a transcript.The fix
buildHarvestContract()insrc/core/harvest.tsthat builds the prompt without requiring session-specific inputs.runPromptMode()insrc/commands/harvest.tsto emit the static contract when no transcript is provided.(provided at harvest time)— explicit placeholder, no empty holes.Exit code
Remains 0, which is now correct: the command succeeded and produced the contract. A caller distinguishes success from the old silent skip by checking stdout content.
Tests
--prompt-onlywith no other flags prints the contract and exits 0Fixes #229