Skip to content

feat(forge): definition-of-done card contract + card gate + sop-to-skills offer - #31

Merged
aegntic merged 1 commit into
mainfrom
feat/done-contract
Sep 2, 2026
Merged

feat(forge): definition-of-done card contract + card gate + sop-to-skills offer#31
aegntic merged 1 commit into
mainfrom
feat/done-contract

Conversation

@aegntic

@aegntic aegntic commented Sep 2, 2026

Copy link
Copy Markdown
Owner

What

Operationalizes the Runable definition-of-done thesis inside the forge.

Contents

  • agent-forge/docs/card-contract.md: the DONE schema every delegation card must carry (3-7 machine-checkable DONE IF criteria, Maintainable-by line, Unplug test, Business link) plus anti-gaming rules (worker never grades own homework, counts expensive to fake)
  • agent-forge/tools/card_gate.py: gate that refuses cards lacking a valid DONE section; --strict rejects vague and non-machine-checkable criteria. Verified against three fixtures: proper card DISPATCHABLE, DONE-less card REJECTED, vague card REJECTED (3 findings)
  • 05_Clients/offer-sop-to-skills.md: the flagship SOP-to-skills service offer, pricing anchors from the intel wiki marked [unverified as market rates], proof links to public repos

Verification

  • python3 -m py_compile passes
  • card_gate.py: 3 fixture tests (good/bad/vague) behave as specified
  • markdownlint clean after h1 fix (pre-commit enforced)

Summary by Sourcery

Operationalize definition-of-done requirements across agent-forge cards and introduce an SOP-to-skills service offering.

New Features:

  • Add a card contract defining machine-checkable completion criteria, maintainability expectations, unplug testing, and business linkage for delegation cards.
  • Add a strict card gate that validates delegation cards before dispatch and rejects missing or vague definitions of done.
  • Add a draft SOP-to-skills service offer covering delivery, pricing, monitoring, handover, and proof points.

Enhancements:

  • Establish anti-gaming and independent verification guidance for completion claims.

Documentation:

  • Document the definition-of-done card schema, verification rules, anti-gaming measures, and card template.

Copilot AI lite review requested due to automatic review settings September 2, 2026 03:52
@sourcery-ai

sourcery-ai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR operationalizes the definition-of-done thesis by documenting a delegation-card contract, enforcing its required fields with a strict-capable dispatch gate, and packaging the approach into a draft SOP-to-skills commercial offer.

Flow diagram for delegation card dispatch gating

flowchart TD
    Card[Delegation card] --> Gate[card_gate.py]
    Gate --> Done{Has valid DONE section?}
    Done -->|No| Reject[REJECTED]
    Done -->|Yes| Criteria{3-7 checkable criteria?}
    Criteria -->|No| Reject
    Criteria -->|Yes| Fields{Maintainable by, Unplug test, Business link?}
    Fields -->|No| Reject
    Fields -->|Yes| Dispatch[DISPATCHABLE]
    Strict[--strict] -.-> Gate
    Strict -.-> Vague{Reject vague or non-checkable criteria}
Loading

File-Level Changes

Change Details Files
Adds a formal definition-of-done contract for delegation cards.
  • Requires 3–7 machine-checkable DONE IF criteria.
  • Requires maintainability, clean-checkout unplug, and business-link declarations.
  • Documents verification and anti-gaming rules, including independent completion review.
agent-forge/docs/card-contract.md
Introduces a card dispatch gate that validates the DONE contract.
  • Parses the DONE section and enforces criterion count plus required contract fields.
  • Adds strict-mode heuristics for vague and non-machine-checkable criteria.
  • Reports dispatchable or rejected status with actionable findings and documented exit codes.
agent-forge/tools/card_gate.py
Adds a draft customer-facing SOP-to-skills service offer.
  • Defines a four-stage delivery model from SOP audit through handover.
  • Provides setup and monitoring-retainer pricing with explicit market-rate uncertainty.
  • Connects the offer to public implementation proof and qualification criteria.
05_Clients/offer-sop-to-skills.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: f3f7e803-aeb6-43ab-9288-485d01113eed


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new gate/docs include concrete mismatches (documented strict requirements not enforced, inconsistent schema wording, and an inaccurate success criteria count) plus the PR claims fixture verification that isn’t present in-repo.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR operationalizes a “definition of done” contract for agent-forge delegation cards by adding a formal DONE schema plus a CLI gate that rejects cards without a compliant DONE section, and it also adds a draft SOP-to-skills client offer document.

Changes:

  1. Adds agent-forge/docs/card-contract.md defining a machine-checkable DONE schema, verification rules, and anti-gaming guidance.
  2. Adds agent-forge/tools/card_gate.py, a stdlib-only CLI validator that rejects cards missing DONE requirements and optionally applies stricter heuristics.
  3. Adds 05_Clients/offer-sop-to-skills.md, a draft service offering describing delivery, pricing anchors, and proof points.
File summaries
File Description
agent-forge/tools/card_gate.py New CLI gate to validate delegation cards contain a compliant ## DONE block (with optional strict checks).
agent-forge/docs/card-contract.md New written contract describing the DONE schema and verification/anti-gaming rules that the gate enforces.
05_Clients/offer-sop-to-skills.md New draft client-facing offer tying the DONE discipline to a packaged SOP-to-skills service.
Review details

Suppressed comments (3)

agent-forge/tools/card_gate.py:14

  • The docstring says --strict "requires the reviewer line", but the implementation does not validate any reviewer line. Either enforce a reviewer field in strict mode, or (simpler) update the docstring to match actual behavior.
Exit codes: 0 = dispatchable; 1 = rejected (report on stdout).
--strict additionally requires the reviewer line and rejects vague
criteria (no digits, no file paths, no commands) heuristically.

agent-forge/tools/card_gate.py:46

  • DONE_RE.search(text) is executed twice; store the match once and reuse it to avoid redundant work and keep the parsing logic in one place.
    if not DONE_RE.search(text):
        return False, ["card has no '## DONE' section; see agent-forge/docs/card-contract.md"]

    done_block = DONE_RE.search(text)
    # capture from DONE header to next ## or EOF
    tail = text[done_block.end():]

agent-forge/tools/card_gate.py:88

  • On success, the reported criteria count is computed by scanning the entire file, which can over-count if "DONE IF" appears outside the ## DONE section (and it rereads the file). Consider removing the count or computing it from the DONE block.
    if ok:
        print(f"DISPATCHABLE: {path.name} ({len(CRITERION_RE.findall(path.read_text(encoding='utf-8')))} criteria)")
        return 0
  • Files reviewed: 3/3 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +9 to +15
Usage:
python3 card_gate.py <card.md> [--strict]

Exit codes: 0 = dispatchable; 1 = rejected (report on stdout).
--strict additionally requires the reviewer line and rejects vague
criteria (no digits, no file paths, no commands) heuristically.
"""
Comment on lines +58 to +61
- The skill pipeline: github.com/aegntic/cognitive-os (agent-forge)
- The quality gates that run on every deliverable: same repo,
agent-forge/tools/qc.py
- A working end-to-end skill with examples: github.com/aegntic/tab-harvest
Comment on lines +26 to +28
2. **The second-best-engineer test.** State who could maintain the
output: "DONE IF a competent non-author reviewer can open any file
produced and explain its purpose in under 20 minutes." For code:
@aegntic

aegntic commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

The 'Lint, Format & Test' failure is the pre-existing prettier rot in 02_Showcase/THRESHOLD-INC and brik-pro (50 files, unchanged on this branch; same failure on main since PR #28 documented it). Zero files touched by this PR appear in the failure log: this PR adds only agent-forge/docs/card-contract.md, agent-forge/tools/card_gate.py, 05_Clients/offer-sop-to-skills.md, all prettier-clean locally. All other 8 checks pass.

@aegntic
aegntic merged commit d50327f into main Sep 2, 2026
10 of 11 checks passed
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.

2 participants