feat: surface contract requirements on the site - #345
Merged
Conversation
Receiving half of the extractor change. requirements carries what a player must have or do before accepting - facts authored by the sender, never the contract's own sentences, because the description is mission prose we must not republish. Modelled on the wire or serde drops it: record is built by re-serializing this tree, so an unmodelled field vanishes on ingest while the push still answers 200. That is how reward.additional was lost and it is the third time this pattern has bitten. Folded into search_blob: 'can I take this contract' is a search, not a browse, and 'tractor beam' is exactly what someone types. Rendered ABOVE reward, deliberately. Requirements decide whether a player can take the contract at all, so they matter before the payout does. Section omits entirely when empty - most contracts state none. Mutation-verified.
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.
Replaces #344, which was orphaned when its base branch (#343) was squash-merged and deleted. Same commit, cherry-picked onto a clean branch off
next.What
Closes the gap you identified: requirements stated in a contract's description had nowhere to go.
ExtractedContracthad no field for them, so the extractor read them and dropped them.required_reputationcovers only the rep gate; a step'srequired_itemis per-step.Now:
requirements: Vec<String>on the wire, folded intosearch_blob, rendered on the detail page. Extractor half is in sp-ingest (eaed576).Facts, not sentences
The description is CIG's mission prose, and
boundary.pyforbids republishing it — the rule that produced #341 tonight. So the prompt is explicit that these are authored facts:Write the fact, not the wording; under ~8 words; empty when there are no prerequisites.
Three deliberate choices
Modelled on the wire, not left to ride along.
recordis built by re-serializing this tree, so an unmodelled field vanishes on ingest while the push still answers200. That's howreward.additionalwas lost — the third time this pattern has bitten — so the test asserts on the stored record, not the status code.Folded into
search_blob. "Can I take this contract?" is a search, andtractor beamis what someone types.Rendered above the reward. Requirements decide whether a player can take the contract at all, so they matter before the payout. Section omits entirely when empty, since most contracts state none.
Merge unions them (extractor side): requirements come from the description — the pane a scroll hides — so the capture holding them frequently loses the scalar merge. Riding along with the winner would drop them silently.
Test plan
1008 + 980 Rust, 663 web, clippy clean, lint clean, no codegen drift. Wire round-trip, search-blob inclusion, merge union, both render cases — all mutation-verified.
Requirements appear only for contracts published after the prompt change (
PROMPT_VERSION→038059c06ba8).