Skip to content

Commit 42ce9c9

Browse files
committed
0.2.0
1 parent 34e8dc1 commit 42ce9c9

41 files changed

Lines changed: 1086 additions & 694 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "pyrs",
33
"description": "Your context engineering doesn't survive the session. Pyrs gives AI agents persistent architectural contracts that do.",
4-
"version": "0.1.9",
4+
"version": "0.2.0",
55
"author": {
66
"name": "Zach Button"
77
}

README.md

Lines changed: 110 additions & 85 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ Defines the pyramid-first discipline: all changes to code must originate in pyra
66

77
## Concepts
88

9-
- **Pyramid-first.** The path is always: describe the change conceptually (new or update), verify alignment (audit), then implement (implement or tighten). Code is never modified outside this flow.
10-
- **Bootstrap exception.** When adopting pyrs on existing code or capturing manually-written code, bootstrap reverses the flow — it reads code and produces pyramids. Once bootstrap completes, the pyramid-first rule applies to all future changes.
9+
- **Pyramid-first.** The path is always: describe the change conceptually (spec), verify alignment (sane), then apply the code (apply). Code is never modified outside this flow.
10+
- **Ingest exception.** When capturing pyramids from existing code, ingest reverses the flow — it reads code and produces pyramids. Use it when adopting pyrs, when capturing manually-written code, or when re-ingesting code that has evolved.
1111
- **Strict scoping.** Implementation is bounded by the target pyramid. An agent implementing a pyramid builds only what that pyramid describes. Dependencies that don't exist yet get placeholders, not implementations.
1212
- **Provenance tracking.** Code and tests generated from pyramids carry provenance comments (`// PYRS: identifier`) so the connection between concept and code is traceable. Unbuilt dependencies get `// PYRS_TODO` placeholders with runtime logging.
1313
- **Opt-out for code markers.** A pyramid (or any ancestor) can include a constraint prohibiting code markers. This opt-out is inherited by all descendants and causes provenance comments and placeholders to be omitted entirely.
14-
- **The audit loop.** The feedback loop between pyramids and code: define or revise a concept, audit for hierarchy fit, implement or tighten the code, review for drift. This loop runs continuously across sessions.
14+
- **The audit loop.** The feedback loop between pyramids and code: define or revise a concept (spec), check for hierarchy fit (sane), apply the code (apply), check for drift (diff). This loop runs continuously across sessions.
1515

1616
## Contracts
1717

18-
- All code changes flow through `implement` or `tighten` — these are the only routes from pyramid to code.
18+
- All code changes flow through `apply` — this is the only route from pyramid to code.
1919
- Implementation scope is strictly bounded by the target pyramid. No parent scope, no child scope, no undocumented extras.
2020
- Unbuilt dependencies produce `PYRS_TODO` placeholders with meaningful runtime logging, unless the pyramid opts out of code markers.
2121
- Code generated from a pyramid carries `PYRS: identifier` provenance comments, unless the pyramid opts out of code markers.
@@ -24,12 +24,12 @@ Defines the pyramid-first discipline: all changes to code must originate in pyra
2424

2525
## Relationships
2626

27-
- Parent: [Pyrs](./index.md)
28-
- See Also: [Pyramid Model](./pyramid-model/index.md) — the change flow operates on the structures defined by the model
29-
- See Also: [Commands](./commands/index.md) — commands are the mechanism through which the change flow is executed
27+
- Parent: [Pyrs](../index.md)
28+
- See Also: [Pyramid Model](../pyramid-model/index.md) — the change flow operates on the structures defined by the model
29+
- See Also: [Commands](../commands/index.md) — commands are the mechanism through which the change flow is executed
3030

3131
## Constraints
3232

33-
- The change flow must not allow direct code modification outside of `implement` and `tighten`. Bootstrap does not modify code — it only reads code and produces pyramids.
33+
- The change flow must not allow direct code modification outside of `apply`. Ingest does not modify code — it only reads code and produces pyramids.
3434
- Placeholders must not silently degrade — they must produce visible runtime output so missing pieces are noticed, not ignored.
3535
- The agent must never silently resolve ambiguity during any phase of the flow. Probing over assuming is non-negotiable.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Apply
2+
3+
## Purpose
4+
5+
Produce or update code from a pyramid using incremental test-driven development. Apply is the only route from concept to code — it handles both building from scratch and updating existing code to match a revised pyramid.
6+
7+
## Concepts
8+
9+
- **Syntax:** `::apply P` — P is an `@`-prefixed pyramid reference targeting the pyramid to implement or re-align code to. P may be identifier form (for example, `@auth.oauth` or `@root.auth.oauth`) or a direct pyramid `index.md` link (for example, `@./pyramids/auth/oauth/index.md`).
10+
- **Building from scratch.** When no code exists for the pyramid, the agent reads the pyramid, detects the project's test framework, and works through red/green cycles incrementally — one contract at a time, never in batch.
11+
- **Updating to match revisions.** When code already exists and the pyramid has been revised via ::spec, the agent compares the updated pyramid against existing code, identifies gaps, and tightens incrementally. Code the pyramid no longer describes is removed.
12+
- **Strict TDD.** Write a failing test for a contract, make it pass, move to the next contract. Non-negotiable and step-by-step.
13+
- **Strict scoping.** Only what the target pyramid describes. Not the parent's behavior, not the children's behavior, not helpful extras.
14+
- **PYRS_TODO placeholders.** Unbuilt dependencies get `// PYRS_TODO: ./pyramids/[path]` placeholders with runtime logging rather than guessed implementations.
15+
- **PYRS provenance comments.** Generated code carries comments linking back to the source pyramid, unless the pyramid opts out.
16+
- **Post-apply diff reconciliation.** If the target pyramid has a sibling `diff.md`, apply runs a same-target diff pass after code updates so the report is either refreshed with remaining gaps or deleted when fully reconciled.
17+
18+
## Contracts
19+
20+
- Apply is the only command that produces or modifies code.
21+
- Apply uses incremental TDD — one contract at a time, red then green, no batching.
22+
- Implementation scope is strictly bounded by the target pyramid.
23+
- Unbuilt dependencies produce PYRS_TODO placeholders with meaningful runtime logging, unless the pyramid opts out of code markers.
24+
- Generated code carries PYRS provenance comments, unless opted out.
25+
- When updating, code the pyramid no longer describes is removed.
26+
- After apply mutates code for target P, if sibling `diff.md` exists for P before or after the mutation, apply must run a same-target diff pass before final output.
27+
28+
## Relationships
29+
30+
- Parent: [Code Output](../index.md)
31+
- See Also: [Spec](../../pyramid-output/spec/index.md) — spec revises pyramids, apply updates code to match
32+
- See Also: [Mend](../../pyramid-output/mend/index.md) — mend patches pyramids, then routes to apply for the code fix
33+
34+
## Constraints
35+
36+
- Apply must not modify pyramids. It consumes pyramids and produces code.
37+
- The agent must not skip TDD or batch multiple contracts.
38+
- Placeholders must not be replaced with guesses. Only a subsequent apply of the dependency's pyramid replaces a placeholder.
39+
- Post-apply diff refresh must be limited to the target scope. Apply must not trigger broad diff sweeps unless the user explicitly requested that scope.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Code Output
2+
3+
## Purpose
4+
5+
Commands that produce or update code from pyramids. This is the only route from concept to code in the system, using incremental test-driven development to ensure code matches contracts.
6+
7+
## Concepts
8+
9+
- **Apply** is the single command that produces and modifies code. It handles both building a pyramid's concept from scratch and updating existing code to conform to a revised pyramid.
10+
- **Test-driven development.** Apply follows strict TDD: write a failing test for a contract, make it pass, move to the next contract. This is non-negotiable and step-by-step — the agent does not batch multiple contracts into one implementation pass.
11+
- **Strict scoping.** The agent implements only what the target pyramid describes. Not the parent's behavior. Not the children's behavior. Not helpful extras. Scope discipline is what makes the pyramid system trustworthy.
12+
- **Placeholders for unbuilt dependencies.** When a child or See Also reference hasn't been implemented, the agent leaves a `// PYRS_TODO: ./pyramids/[path]` placeholder with runtime logging rather than guessing at the dependency's behavior.
13+
- **Post-apply diff refresh.** When the target pyramid already has a sibling `diff.md`, apply runs a same-target diff pass after code changes so the report is immediately updated or removed.
14+
15+
## Contracts
16+
17+
- Apply is the only command that produces or modifies code.
18+
- Apply uses incremental TDD — one contract at a time, red then green, no batching.
19+
- Implementation scope is strictly bounded by the target pyramid. No parent scope, no child scope, no undocumented behavior.
20+
- Unbuilt dependencies produce PYRS_TODO placeholders with meaningful runtime logging, unless the pyramid opts out of code markers.
21+
- Generated code carries PYRS provenance comments linking back to the source pyramid, unless opted out.
22+
- After apply mutates code for target P, if sibling `diff.md` exists for P before or after the mutation, apply runs a same-target diff pass before final output.
23+
24+
## Relationships
25+
26+
- Parent: [Commands](../index.md)
27+
- Children:
28+
- [Apply](./apply/index.md) — produce or update code from pyramids
29+
- See Also: [Change Flow](../../change-flow/index.md) — apply is the code-producing step of the change flow
30+
31+
## Constraints
32+
33+
- Code output commands must not modify pyramids. They consume pyramids and produce code.
34+
- The agent must not skip TDD or batch multiple contracts. The incremental discipline is what ensures each contract is independently verified.
35+
- Placeholders must not be replaced with guesses. Only a subsequent apply of the dependency's pyramid replaces a placeholder.
36+
- Post-apply diff refresh must stay target-scoped. Code output commands must not run broad multi-target diff sweeps unless the user explicitly requested that scope.

pyramids/commands/creation.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

pyramids/commands/implementation.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)