Skip to content

feat: surface contract requirements on the site - #345

Merged
ntatschner merged 1 commit into
nextfrom
feat/contract-requirements-v2
Jul 31, 2026
Merged

feat: surface contract requirements on the site#345
ntatschner merged 1 commit into
nextfrom
feat/contract-requirements-v2

Conversation

@ntatschner

Copy link
Copy Markdown
Collaborator

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. ExtractedContract had no field for them, so the extractor read them and dropped them. required_reputation covers only the rep gate; a step's required_item is per-step.

Now: requirements: Vec<String> on the wire, folded into search_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.py forbids republishing it — the rule that produced #341 tonight. So the prompt is explicit that these are authored facts:

"Completing this contract requires that you bring your own hydrogen fuel""Must supply own hydrogen fuel"

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. record is built by re-serializing this tree, so an unmodelled field vanishes on ingest while the push still answers 200. That's how reward.additional was 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, and tractor beam is 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_VERSION038059c06ba8).

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.
@ntatschner
ntatschner merged commit f68a0af into next Jul 31, 2026
12 checks passed
@ntatschner
ntatschner deleted the feat/contract-requirements-v2 branch July 31, 2026 03:06
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