agentleFS
sponge-b0bsponge-b0b/Polaris/.agents/skills/spec-contract/SKILL.md

spec-contract

Skill4 starsChanged 3 months agoApache-2.0View on GitHub

Build or validate the deterministic contract of one CCL-backed Spec without semantically reinterpreting Spec prose.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Do not build Source Unit inventories, classify prose as normative/non-normative, invent NORM-*, or infer architecture obligations from …

    line 32
  2. Very specific:

    Every cell carries its own deterministic cell_hash.

    line 74

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Spec Contract

$spec-contract is a deterministic helper. It does not decide what a Spec means.

The Spec's material semantics are already frozen by exact CCL addresses in its spec-contract-ccl:v1 manifest. This helper converts that projection plus explicitly identified private implementation, testing, and exclusion cells into one reproducible contract universe for ticketing, implementation, verification, and review.

Contract cells

A CCL-backed software Spec exposes only:

  • OBL-* — material semantic obligations from spec-contract-ccl:v1; semantic payload is the exact ordered CCL address set;
  • IMP-* — private/mechanical implementation obligations from stable-ID bullets in ## Implementation Decisions;
  • TEST-* — proof/test obligations from stable-ID bullets in ## Testing Decisions;
  • EXC-* — exclusions from stable-ID bullets in ## Out of Scope.

Narrative sections are human context and never create hidden cells. If material behavior is missing, route the Spec back to $to-specs / semantic authority instead of interpreting prose here.

Do not build Source Unit inventories, classify prose as normative/non-normative, invent NORM-*, or infer architecture obligations from ADR/wiki/code prose.

Deterministic builder

Use:

python -m scripts.ccl_spec check <spec-body-file> contracts/ccl/transactions
python -m scripts.spec_contract build <issue-json> <contract-output>
python -m scripts.spec_contract validate <issue-json> <expected-contract>
python -m scripts.spec_contract check-coverage <contract-json> <coverage-json>

The canonical result schema is:

{
  "schema": "polaris.spec-contract/v1",
  "spec_body_hash": "...",
  "spec_contract_hash": "...",
  "cells": [
    {
      "cell": "OBL-001",
      "kind": "material-contract",
      "cell_hash": "...",
      "ccl": ["contract@1#assertion"]
    }
  ]
}

There is no secondary source-unit, normative-classification, or compatibility projection. The cells array is the complete contract universe.

Identity

SPEC_BODY_HASH hashes exact body bytes.

SPEC_CONTRACT_HASH hashes the exact ordered contract-cell identity. Narrative-only prose may change the body hash without changing the contract hash.

Every cell carries its own deterministic cell_hash. Downstream reconciliation uses cell + cell_hash; matching IDs alone never hide changed contract content.

Changing any OBL-* CCL address set or the exact content of an IMP-*, TEST-*, or EXC-* cell changes its cell hash and therefore the Spec Contract Hash.

Coverage validation

For ordinary ticketing, $to-tickets supplies exactly one:

{
  "schema": "polaris.ticket-coverage/v2",
  "spec_contract_hash": "...",
  "routes": [
    {"cell": "OBL-001", "cell_hash": "...", "destination": "T1"}
  ],
  "exclusions": [
    {"cell": "EXC-001", "cell_hash": "..."}
  ]
}

check-coverage requires every non-exclusion cell exactly once, every exclusion exactly once outside ticket routing, no unknown cells, and exact current hashes.

Ticket contract

For an ordinary ticket use:

python -m scripts.spec_contract build-ticket \
  <contract.json> <coverage.json> "#<ticket>" <ticket-body> <output>

The result is polaris.ticket-contract/v1: exact assigned executable cells plus every parent exclusion as a guardrail and one deterministic Ticket Contract Hash.

Return

SPEC CONTRACT: VALID | INVALID
Spec Body Hash: <sha256>
Spec Contract Hash: <sha256>
Contract cells: <n>
Semantic prose classification performed: 0

Malformed/missing stable-ID sections, duplicate cells, malformed CCL projection, coverage drift, or ticket projection drift are deterministic failures. They are not permission to reconstruct intended meaning from prose.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.