Repository navigation
Conversation
I want one way to turn scoped work into contract tasks, the same in every repository. `proofline contract decompose <scope.json> --out <proposal.json>` reads a proofline-scope/1 file (an id prefix, tasks with title, acceptance checks, requirement ids, dependencies and an owner placeholder, plus shared defaults and criteria put before or after each task's own) and writes an unsigned proposal that `contract merge` accepts. - Byte-stable output: fixed key order, criterion ids <task>-AC01..., two-space JSON and a final newline; the command prints the sha256. - Refuses a duplicate id (in the scope or in an --against contract), an unknown dependency, a cycle and a task `contract validate` would refuse; nothing is written then. --lint-warn reports the validate findings as warnings for contracts that already carry tasks of that shape. - Never writes proofline.json or a .sig. --check exits 1 when the committed proposal is not the output of its scope file, for CI. docs/DECOMPOSITION.md is the process: scope file, decompose, validate and coverage, proposal PR that leaves proofline.json alone, the owner's go, fold with `contract merge`, sign, verify-sig, with a CI job. Tests cover the golden file, duplicate refusal, the merge round-trip with validate and coverage, and the refusal to write a contract or signature, on a toy fixture. Signed-off-by: mgillr <36207807+mgillr@users.noreply.github.com>
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
Adds
proofline contract decompose <scope.json> [--out proposal.json] [--against a.json,b.json] [--check] [--lint-warn]anddocs/DECOMPOSITION.md, so scoped work becomes contract tasks the same way in every repository.A scope file (
proofline-scope/1, JSON) holds an id prefix and tasks with their title, acceptance checks, requirement ids, dependencies and an owner placeholder. It can also hold shared defaults and criteria that go before or after each task's own.decomposeturns it into an unsigned proposal thatcontract mergeaccepts.<task>-AC01..., two-space JSON and a final newline. The command prints the sha256.--againstcontract), an unknown dependency, a cycle, and a taskcontract validatewould refuse. Nothing is written in those cases.--lint-warnturns the validate findings into warnings, for a contract whose existing tasks already have that shape.proofline.json, any file with that name, or a.sig.--checkexits 1 when the committed proposal is not the output of its scope file. This is for CI.docs/DECOMPOSITION.mddescribes the process:decompose.--checkandcoverage.proofline.jsonalone.contract mergeon a sign branch.validate,signandverify-sig.It also covers amending existing tasks, lists the roles, and includes a CI job that checks proposals against their scopes, validates the contract and verifies its signature, with a variant for contracts in subdirectories.
Requirement IDs
None new. This builds on
contract merge,coverage,validate,signandverify-sig.Scope and exclusions
src/decompose.mjs,test/contract_decompose.test.mjs,fixtures/decompose/(a toyexample-projectscope, its golden proposal and a REQUIREMENTS.md), anddocs/DECOMPOSITION.md.bin/proofline.mjs(the subcommand, its flags and help text),test/cli_unknown_flags.test.mjs(the new subcommand is in the list), and the README, CHANGELOG and docs index.proofline.json,proofline.json.sigandsrc/contract.mjsare unchanged.mergestill only appends. A proposal that changes existing tasks is folded withmergeand a reviewed edit, as described in the doc.Verification performed
node --test test/contract_decompose.test.mjs test/cli_unknown_flags.test.mjs--against), unknown dep and cycle, no write toproofline.jsonor.sig,--checkdrift, merge round-trip followed byvalidateandcoveragenpm test(Node 22, clean global git config as in CI)the fixture pins the image digest and an isolated command records it. It needs a container runtime, which this machine lacks, and it fails the same way onmainnode examples/demo/demo.mjs --quiet;node bin/proofline.mjs --root examples/demo-contract contract validatenpx markdownlint-cli2with the repo configdocs/DECOMPOSITION.mdis clean. The CHANGELOG gains one MD024 (a repeated### Added), which is the file's existing conventionmergeof the output into an emptied contract gives the original JSON backIndependent challenge
--againstfiles, and refuses to write any contract or signatureDocumentation and changelog