swift-evaluate-parity
Skill8 starsChanged 6 days agoApache-2.0View on GitHub
Pinned 0.11.0 evaluate contract for rv. Use when changing RVEngine / RVDomain evaluate types, day-one pack JSON, CompiledPacks, normalize / quote-mask, quick-reject, walkers, corePacksUnavailable, or Tests/**/corpus/*. Not for hook or XPC Decision encoding (swift-hook-xpc). Also /swift-evaluate-parity.
- Deletes or force-pushes
- Commits and pushes
In this repository18 other files it gives its agents.
- codebase-designSkill
- principle-type-system-disciplineSkill
- swift-64-concurrencySkill
- swift-adversarial-pr-reviewSkill
- swift-api-design-guidelinesSkill
- swift-concurrencySkill
- swift-functional-architectureSkill
- swift-functional-coreSkill
- swift-hexagonal-spmSkill
- swift-hook-xpcSkill
- swift-pr-orchestrationSkill
- swift-protocol-boundariesSkill
- swift-pr-reviewSkill
- swift-systems-safetySkill
- swift-testing-proSkill
- swift-thermo-nuclear-reviewSkill
- swift-type-system-architectureSkill
- swift-value-semanticsSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 40
Keep evaluate pure. Clock, disk, and ProcessInfo stay out.
- Distinctive: line 42
Add or update a corpus row that would fail if the change is wrong.
- Very specific: line 51
Run tools/gate.sh (or the filters above) before claiming done.
- Very specific: line 74
Do not restyle the signature to some.
- Very specific: line 78
No boolean isDenied. Decision shape lives in Decision.swift.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.
Files
swift-evaluate-parity
Internal. The T1 contract as a skill.
The scoreboard is docs/dev/PARITY.md + vendor/parity/PIN (same
Decision + rule_id as the pinned 0.11.0 engine source). Marketing rows
that disagree are quarantine, not the scoreboard. This file is not the
scoreboard.
Spec: docs/factory/specs/phase-1-engine.md. PLAN wins conflicts.
Landmines: references/landmines.md.
Load first
docs/dev/PARITY.mdandvendor/parity/PINSources/RVDomain/Decision.swift,Severity.swift,EvaluationResult.swiftSources/RVEngine/Evaluate.swift,Normalize.swift,QuickReject.swift,CompiledPacks.swift,PatternEngine.swift,ICUPatternEngine.swiftTests/RVEngineTests/Fixtures/corpus/(deny.json,near-miss.json,quarantine.json,skill-table.json)docs/architecture/never-slip.mddocs/architecture/residual-risk.md
Steps
- State the expected
Decision+rule_idfrom the pin, not from a marketing table. - Keep
evaluatepure. Clock, disk, andProcessInfostay out. - Preserve evaluation order. Do not “simplify” extracted regexes.
- Add or update a corpus row that would fail if the change is wrong.
Prove on 6.3.3 (not
/usr/bin/swift):tools/swift-6.3.3 --version # expect Apple Swift version 6.3.3 tools/gate.sh --quiet RVEngineTests RVCorpusTests tools/swift-6.3.3 test --filter packLoad- Run
tools/gate.sh(or the filters above) before claiming done.
Order (locked)
On the raw command, before normalize:
- Empty / whitespace-only after trim →
allow. raw.utf8.count > 65_536→indeterminate(.commandTooLarge),quickRejected == false.- Missing or empty
core.git/core.filesystemsnapshots →indeterminate(.corePacksUnavailable). Not a fakedenyrule_id.
Then: normalize → quick-reject → per enabled pack, lex by PackID.rawValue
safe then destructive (a safe hit skips that pack only) → default allow.
- Budget exhausted →
indeterminate(.budgetExhausted). - Critical / high match →
deny+RuleMatch. - Medium / low match →
allow+RuleMatch. Keep scanning for a blocker. - Unknown command (finished scan, no rule hit) →
allow. That is not fail-closed on unknown. Missing core packs, oversize, and budget areindeterminate, not unknown. Hooks must not treatindeterminateas allow (swift-hook-xpc). evaluateis generic overPatternEngineplus already-compiled packs. Do not restyle the signature tosome.RVEnginedoes not importRVPacks. Packs are JSON data, not Swift files.
Severity.blocksByDefault is critical/high only (Sources/RVDomain/Severity.swift).
No boolean isDenied. Decision shape lives in Decision.swift. Deny always
carries RuleID + reason. RuleID.rawValue is pack:pattern
(core.git:reset-hard). Display slash form is a T2 concern.
Multi-segment: split the matching view on top-level && || ; |.
First deny / indeterminate wins. If every segment allows, evaluate the
full string once.
PatternEngine
ICU first (NSRegularExpression). Compile at pack load, not in the hot loop.
A compile miss quarantines that pattern name and its rows; the pack
still loads. Never quarantine core.git:reset-hard or
core.filesystem:fork-bomb.
Extract the 0.11.0 regex. Do not rewrite a walker to make a test green.
Corpus
| File | Role |
skill-table.json | Command rows from upstream skill tables. expected = pin Decision + rule_id. Never write a marketing Decision here. |
deny.json | Extra true-positives (wrappers, multi-segment, filesystem bypasses). Bare git reset --hard stays in skill-table.json. Do not empty this file down to that one command. Marketing “blocked” rows that the pin allows go to quarantine.json, never here. |
near-miss.json | Must allow on pack evaluate (see landmines). Shrinking this file is a fail. Those landmine ids are required; deleting a row to go green is a fail. |
quarantine.json | SKILL.md drift + ICU misses. Expected decision stays the pin. |
RVCorpusTests runs each command row twice: pack evaluate (pin JSON expected) and evaluateWithSemantics (pack deny is the floor; RV-RR-02 quiet-work near-miss ids stay door allow; other pack allows may tighten only to builtin.action). Door-positive canaries (python -c os.system, bash -c $CMD, git push --force-with-lease origin feature) must fail if door is pack evaluate. Do not drop the pin run to “just use the door.” Do not rewrite JSON expected to a door tighten.
Day-one packs only: core.git + core.filesystem. T9 imports the rest
default-off.
Preflight
Run tools/gate.sh --quiet RVEngineTests RVCorpusTests (and packLoad if
needed). Gate runs tools/preflight.sh then filtered tests on 6.3.3. Then
re-read the remaining list for semantic judgments.
- Expected verdict matches
PARITY.md, not a marketing row. - Raw gates still run before normalize; then per-pack lex safe → destructive.
- Medium/low stays
allow+ match (git stash dropis the canary). git stash dropis not adeny.jsonrow. A marketing “blocked” line isquarantine.jsonwithexpected: allow.- Empty core packs / oversize / budget →
indeterminate, not an invented deny. - No regex in the diff was “simplified.”
near-miss.jsonstill contains the landmine rows.reset-hardandfork-bombare not inquarantine.json.evaluategained no I/O.RVEngineTests+RVCorpusTests+packLoadgreen viatools/gate.sh/tools/swift-6.3.3.
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
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.

