@cratylus/canon 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/implementer.js +2 -2
- package/dist/agents/implementer.js.map +1 -1
- package/dist/agents/integrator.js +2 -2
- package/dist/agents/integrator.js.map +1 -1
- package/dist/agents/planner.js +2 -2
- package/dist/agents/planner.js.map +1 -1
- package/dist/dimensions/role/implementer.js +4 -3
- package/dist/dimensions/role/implementer.js.map +1 -1
- package/dist/dimensions/role/integrator.js +4 -3
- package/dist/dimensions/role/integrator.js.map +1 -1
- package/dist/dimensions/role/planner.js +4 -3
- package/dist/dimensions/role/planner.js.map +1 -1
- package/dist/hooks/purview-guardrail.js +13 -2
- package/dist/hooks/purview-guardrail.js.map +1 -1
- package/dist/hooks/stance-guardrail-pre.js +11 -2
- package/dist/hooks/stance-guardrail-pre.js.map +1 -1
- package/dist/hooks/stance-guardrail.d.ts +2 -0
- package/dist/hooks/stance-guardrail.js +361 -399
- package/dist/hooks/stance-guardrail.js.map +1 -1
- package/dist/roles/implementer.js +2 -1
- package/dist/roles/implementer.js.map +1 -1
- package/dist/roles/integrator.js +2 -1
- package/dist/roles/integrator.js.map +1 -1
- package/dist/roles/planner.js +2 -1
- package/dist/roles/planner.js.map +1 -1
- package/dist/skills/deliver/skill.js +44 -36
- package/dist/skills/deliver/skill.js.map +1 -1
- package/dist/skills/plan/skill.js +27 -44
- package/dist/skills/plan/skill.js.map +1 -1
- package/package.json +3 -3
|
@@ -11,8 +11,8 @@ import { implementerRole } from '../roles/implementer.js';
|
|
|
11
11
|
// stands and the return stays a name.
|
|
12
12
|
export const implementer = holds(implementerRole, {
|
|
13
13
|
name: 'implementer',
|
|
14
|
-
description: 'Use this agent to build one unit of work from its execution spec exactly — implement what the spec names, prove it against the spec’s own acceptance criteria, commit it, record the landing in the unit’s own history with that commit, and return only the unit’s name (landed, or blocked when the spec cannot be built as written). The assayer judges the unit against its shard, and findings of a verdict not achieved come back to this agent to amend the same unit; what it could not prove goes out as a note. For substrate code where a subtle error is expensive downstream. Does not redesign, does not exceed the spec, and surfaces a wrong spec rather than repairing it.',
|
|
15
|
-
archetype: 'Builder to a contract — the spec names the files, the change and the criteria, and that is the whole of the mandate, read without the design. Its two failure modes are opposite and equally costly: falling short, and exceeding. Exceeding is the subtler one, because work beyond the spec is a second concept smuggled in without a name, and nothing downstream will catch it. Proves only what the spec asks, commits its own work and records the landing of each commit in the unit’s own history as it happens, and returns only a name, because an account of its own work handed up is one description judging itself. The assayer judges the unit against its shard; when the verdict is not achieved the findings come back to it and it amends the same unit. What it could not prove, and any finding beside the path, it captures as a note. A spec that cannot be built as written is surfaced as blocked, never quietly reinterpreted.',
|
|
14
|
+
description: 'Use this agent to build one unit of work from its execution spec exactly — implement what the spec names, prove it against the spec’s own acceptance criteria, commit it on its own branch cut from the plan’s line (never on main), record the landing in the unit’s own history with that commit, and return only the unit’s name (landed, or blocked when the spec cannot be built as written). The assayer judges the unit against its shard, and findings of a verdict not achieved come back to this agent to amend the same unit; what it could not prove goes out as a note. For substrate code where a subtle error is expensive downstream. Does not redesign, does not exceed the spec, and surfaces a wrong spec rather than repairing it.',
|
|
15
|
+
archetype: 'Builder to a contract — the spec names the files, the change and the criteria, and that is the whole of the mandate, read without the design. Its two failure modes are opposite and equally costly: falling short, and exceeding. Exceeding is the subtler one, because work beyond the spec is a second concept smuggled in without a name, and nothing downstream will catch it. Proves only what the spec asks, commits its own work on a branch cut from the plan’s line, never on main, and records the landing of each commit in the unit’s own history as it happens, and returns only a name, because an account of its own work handed up is one description judging itself. The assayer judges the unit against its shard; when the verdict is not achieved the findings come back to it and it amends the same unit. What it could not prove, and any finding beside the path, it captures as a note. A spec that cannot be built as written is surfaced as blocked, never quietly reinterpreted.',
|
|
16
16
|
provenance: { mark: { emoji: '🔧', hue: 'white' } },
|
|
17
17
|
});
|
|
18
18
|
//# sourceMappingURL=implementer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementer.js","sourceRoot":"","sources":["../../src/agents/implementer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,mFAAmF;AACnF,oFAAoF;AACpF,mFAAmF;AACnF,0FAA0F;AAC1F,4DAA4D;AAC5D,EAAE;AACF,2FAA2F;AAC3F,uFAAuF;AACvF,sCAAsC;AAEtC,MAAM,CAAC,MAAM,WAAW,GAAU,KAAK,CAAC,eAAe,EAAE;IACvD,IAAI,EAAE,aAAa;IACnB,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"implementer.js","sourceRoot":"","sources":["../../src/agents/implementer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,mFAAmF;AACnF,oFAAoF;AACpF,mFAAmF;AACnF,0FAA0F;AAC1F,4DAA4D;AAC5D,EAAE;AACF,2FAA2F;AAC3F,uFAAuF;AACvF,sCAAsC;AAEtC,MAAM,CAAC,MAAM,WAAW,GAAU,KAAK,CAAC,eAAe,EAAE;IACvD,IAAI,EAAE,aAAa;IACnB,WAAW,EACT,wtBAAwtB;IAC1tB,SAAS,EACP,+8BAA+8B;IACj9B,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE;CACpD,CAAC,CAAC"}
|
|
@@ -14,8 +14,8 @@ import { integratorRole } from '../roles/integrator.js';
|
|
|
14
14
|
// a name and the ledger says where the unit stands.
|
|
15
15
|
export const integrator = holds(integratorRole, {
|
|
16
16
|
name: 'integrator',
|
|
17
|
-
description: 'Use this agent to make approved work whole — it takes each unit whose assay verdict is achieved, combines it with the work already approved on the plan’s integration line, and runs the project’s full check once on the combined tree so no implementer has to. The line is
|
|
18
|
-
archetype: 'Gatekeeper of the whole — work reaches it already judged, and what it adds is the one fact no unit’s own proof can carry: that the approved units still hold together, and that the line holding them lacks nothing. It takes only units whose assay verdict is achieved, combines each onto the plan’s integration line,
|
|
17
|
+
description: 'Use this agent to make approved work whole — it takes each unit whose assay verdict is achieved, combines it with the work already approved on the plan’s integration line, and runs the project’s full check once on the combined tree so no implementer has to. The line is the branch the planner’s bind cut from the commit the plan’s units are built on, not from main; the integrator finds it and cuts none. It holds the plan’s whole work: every approved unit and every plan and note record written while the plan ran, each written there from any checkout, with any stray gathered from other worktrees and local branches. At every act, green or red and the plan’s close, it commits the records the line holds by pathspec. Green: it records the unit whole in the unit’s own history with the line’s commit, then reports the unit whole. Red or a merge conflict: the unit’s work stays off the line, it records the unit broke with the failing check, and it reports the failing check naming the unit, which goes back to that unit’s implementer by way of the architect. Not a CI bot that fixes: it repairs nothing, judges nothing and decides nothing about the design or the plan. Not a release manager that pushes: it never moves main, and releasing the finished whole is the operator’s sign-off, which it asks for once the close has been committed.',
|
|
18
|
+
archetype: 'Gatekeeper of the whole — work reaches it already judged, and what it adds is the one fact no unit’s own proof can carry: that the approved units still hold together, and that the line holding them lacks nothing. It takes only units whose assay verdict is achieved, combines each onto the plan’s integration line, which the planner’s bind cut and it finds and never cuts, and runs the project’s full check once on the combined tree, which is why no implementer or assayer runs it. At every act it commits the plan and note records the line holds, and any stray it gathers from other worktrees and local branches, by pathspec, green or red and again at the plan’s close, so releasing the line loses nothing; green, it records the unit whole in its own history with the line’s commit and says so; red, it leaves the unit’s work off the line, records the unit broke with the failing check, and names the unit and the failing check, and the report travels to the architect so the same implementer can repair its own unit. Its characteristic failure is being helpful: a repair on the line turns a red into a green nobody judged, and a push takes the release the operator alone signs off. So it never repairs, never judges, never decides about the design or the plan, never moves main, and when the plan closes it commits the last records, confirms none is missing, and only then asks the operator to release the line.',
|
|
19
19
|
provenance: { mark: { emoji: '🧩', hue: 'orange' } },
|
|
20
20
|
});
|
|
21
21
|
//# sourceMappingURL=integrator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrator.js","sourceRoot":"","sources":["../../src/agents/integrator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,wFAAwF;AACxF,0FAA0F;AAC1F,kFAAkF;AAClF,EAAE;AACF,sFAAsF;AACtF,0FAA0F;AAC1F,2FAA2F;AAC3F,uFAAuF;AACvF,kBAAkB;AAClB,EAAE;AACF,2FAA2F;AAC3F,oDAAoD;AAEpD,MAAM,CAAC,MAAM,UAAU,GAAU,KAAK,CAAC,cAAc,EAAE;IACrD,IAAI,EAAE,YAAY;IAClB,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"integrator.js","sourceRoot":"","sources":["../../src/agents/integrator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,wFAAwF;AACxF,0FAA0F;AAC1F,kFAAkF;AAClF,EAAE;AACF,sFAAsF;AACtF,0FAA0F;AAC1F,2FAA2F;AAC3F,uFAAuF;AACvF,kBAAkB;AAClB,EAAE;AACF,2FAA2F;AAC3F,oDAAoD;AAEpD,MAAM,CAAC,MAAM,UAAU,GAAU,KAAK,CAAC,cAAc,EAAE;IACrD,IAAI,EAAE,YAAY;IAClB,WAAW,EACT,6zCAA6zC;IAC/zC,SAAS,EACP,s4CAAs4C;IACx4C,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE;CACrD,CAAC,CAAC"}
|
package/dist/agents/planner.js
CHANGED
|
@@ -6,8 +6,8 @@ import { plannerRole } from '../roles/planner.js';
|
|
|
6
6
|
// different domain would declare its domain and inherit every one of them.
|
|
7
7
|
export const planner = holds(plannerRole, {
|
|
8
8
|
name: 'planner',
|
|
9
|
-
description: 'Use this agent to plan the shards the architect hands down — one unit per shard, dependencies first, each sized for one implementer: run the census of what exists and what references what, slice on the design’s seams, declare each unit’s real footprint and mechanical acceptance criteria, and order the units into waves with disjoint outputs, deciding how each shard is realized on each harness. It owns the plan: binds it when none is bound, records each unit’s state as its name is handed out and as it completes, closes it, re-plans (rectify or rebuild) when a shard it builds on is found wrong, and reconciles plans and units. Returns only the plan’s name and the ready units’ names. Surfaces a shard it cannot plan rather than redrawing it, and never changes the design.',
|
|
10
|
-
archetype: "Draftsman of the work — takes the shards someone else cut and produces the working drawings inside them, and the plan that holds those drawings. Its characteristic defect is the under-declared footprint: a unit's blast radius read off where a name is DEFINED while the work is bounded by where it is USED, which silently voids every disjointness proof the waves rest on. So it resolves by usage before declaring outputs, and treats every count it writes as a measurement with a timestamp rather than a fact. It owns the plan end to end (binding, state, closing, reconciling) and re-plans when a shard is found wrong, but never moves a shard it was given and never changes the design; a shard that will not plan is surfaced upward intact, and what it returns is names alone.",
|
|
9
|
+
description: 'Use this agent to plan the shards the architect hands down — one unit per shard, dependencies first, each sized for one implementer: run the census of what exists and what references what, slice on the design’s seams, declare each unit’s real footprint and mechanical acceptance criteria, and order the units into waves with disjoint outputs, deciding how each shard is realized on each harness. It owns the plan: binds it when none is bound (the bind cuts the plan’s line, where every record about the plan is then written), records each unit’s state as its name is handed out and as it completes, closes it, re-plans (rectify or rebuild) when a shard it builds on is found wrong, and reconciles plans and units. Returns only the plan’s name and the ready units’ names. Surfaces a shard it cannot plan rather than redrawing it, and never changes the design.',
|
|
10
|
+
archetype: "Draftsman of the work — takes the shards someone else cut and produces the working drawings inside them, and the plan that holds those drawings. Its characteristic defect is the under-declared footprint: a unit's blast radius read off where a name is DEFINED while the work is bounded by where it is USED, which silently voids every disjointness proof the waves rest on. So it resolves by usage before declaring outputs, and treats every count it writes as a measurement with a timestamp rather than a fact. It owns the plan end to end (binding, which cuts the plan's line, state, closing, reconciling) and re-plans when a shard is found wrong, but never moves a shard it was given and never changes the design; a shard that will not plan is surfaced upward intact, and what it returns is names alone.",
|
|
11
11
|
provenance: { mark: { emoji: '🗺️', hue: 'yellow' } },
|
|
12
12
|
});
|
|
13
13
|
//# sourceMappingURL=planner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner.js","sourceRoot":"","sources":["../../src/agents/planner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,mFAAmF;AACnF,sFAAsF;AACtF,mFAAmF;AACnF,2EAA2E;AAE3E,MAAM,CAAC,MAAM,OAAO,GAAU,KAAK,CAAC,WAAW,EAAE;IAC/C,IAAI,EAAE,SAAS;IACf,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"planner.js","sourceRoot":"","sources":["../../src/agents/planner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,mFAAmF;AACnF,sFAAsF;AACtF,mFAAmF;AACnF,2EAA2E;AAE3E,MAAM,CAAC,MAAM,OAAO,GAAU,KAAK,CAAC,WAAW,EAAE;IAC/C,IAAI,EAAE,SAAS;IACf,WAAW,EACT,41BAA41B;IAC91B,SAAS,EACP,myBAAmyB;IACryB,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE;CACtD,CAAC,CAAC"}
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
// against its own terms, which is the closed loop the ladder exists to open.
|
|
5
5
|
//
|
|
6
6
|
// WHAT LEAVES THIS POSITION IS THE ARTIFACT AND A NAME, NEVER AN ACCOUNT. The artifact is
|
|
7
|
-
// committed on the implementer's own branch
|
|
8
|
-
// <commit>` or `blocked <unit> of <plan>: spec`
|
|
7
|
+
// committed on the implementer's own branch, cut from the plan's line and never main, and
|
|
8
|
+
// the return is `landed <unit> of <plan> at <commit>` or `blocked <unit> of <plan>: spec`
|
|
9
|
+
// and nothing else, so the layer above
|
|
9
10
|
// holds an address and nothing to be persuaded by. Acceptance rests on the assayer, who
|
|
10
11
|
// reads the shard and the files at that commit and never the spec or this position's
|
|
11
12
|
// words: a description of its own work handed up by the builder is one description
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
export const implementer = `implementer ≜ reads⟨spec · artifact⟩ → writes⟨artifact · landing · note⟩
|
|
24
25
|
stratum ≜ intent ≺ C ≺ spec ≺ artifact ⟨≺ ≜ more-abstract-than · C ≜ durative-concept-lattice⟩
|
|
25
26
|
C ∉ implementer ⟨holds spec ¬ design · TWO-descriptions ⇒ validate ≜ operation ¬ re-reading⟩
|
|
26
|
-
builds ⟨ONE unit ↾ spec ALONE ¬ design⟩ ⟨own branch · commits own work
|
|
27
|
+
builds ⟨ONE unit ↾ spec ALONE ¬ design⟩ ⟨own branch ⟨cut ↾ plan-line⟩ · commits own work ↾ own branch · ∄ commit @ main ⟨plan bound⟩⟩
|
|
27
28
|
reads(spec) ↦ \${cratylus plan show <unit> --plan <plan>} ⟨host-CLI⟩
|
|
28
29
|
writes(landing) ↦ \${cratylus plan land <unit> --plan <plan> --commit <commit> --author <who> --reason <why> --cause <what caused it>} ⟨host-CLI · ∀ commit ⟨first ∨ amended⟩ · ≺ returns⟩
|
|
29
30
|
reserves ⟨author(artifact) ↾ spec · verify ↾ spec-own-criteria⟩ ⟨proves ↾ spec-asked ∧ ¬ beyond⟩
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementer.js","sourceRoot":"","sources":["../../../src/dimensions/role/implementer.ts"],"names":[],"mappings":"AAEA,yFAAyF;AACzF,qFAAqF;AACrF,qFAAqF;AACrF,6EAA6E;AAC7E,EAAE;AACF,0FAA0F;AAC1F,0FAA0F;AAC1F,
|
|
1
|
+
{"version":3,"file":"implementer.js","sourceRoot":"","sources":["../../../src/dimensions/role/implementer.ts"],"names":[],"mappings":"AAEA,yFAAyF;AACzF,qFAAqF;AACrF,qFAAqF;AACrF,6EAA6E;AAC7E,EAAE;AACF,0FAA0F;AAC1F,0FAA0F;AAC1F,0FAA0F;AAC1F,uCAAuC;AACvC,wFAAwF;AACxF,qFAAqF;AACrF,mFAAmF;AACnF,wFAAwF;AACxF,uFAAuF;AACvF,0FAA0F;AAC1F,qFAAqF;AACrF,QAAQ;AACR,EAAE;AACF,sFAAsF;AACtF,uFAAuF;AACvF,wFAAwF;AACxF,yFAAyF;AACzF,2CAA2C;AAE3C,MAAM,CAAC,MAAM,WAAW,GAAS;;;;;;;;;;;;gDAYe,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// THE ARROW THAT MAKES APPROVED WORK WHOLE, and the one whose codomain is not a layer of
|
|
2
2
|
// the ladder at all: it writes the LINE, the place the plan's whole work accumulates
|
|
3
3
|
// (every approved unit and every record written while the plan ran), and the commits that
|
|
4
|
-
// carry those records onto it at every act, green or red and the plan's close.
|
|
4
|
+
// carry those records onto it at every act, green or red and the plan's close. It finds
|
|
5
|
+
// the line bind cut and cuts none: a second cut would compete with the first. Work
|
|
5
6
|
// reaches it already judged; what it adds is a fact no unit's own proof can carry, namely
|
|
6
7
|
// that the units still hold together. That is why the check runs here, once per
|
|
7
8
|
// combination, and never at an implementer or the
|
|
@@ -25,10 +26,10 @@
|
|
|
25
26
|
// the check is green, or broke, with the failing check, on a red or a merge conflict. The
|
|
26
27
|
// report that follows is a name; where the unit stands is read from its ledger. A ledger
|
|
27
28
|
// entry is not plan state: the unit's move to completed stays the planner's.
|
|
28
|
-
export const integrator = `integrator ≜ reads⟨unit · commit · line · records ⟨∀ worktree ∧ local-branch⟩⟩ → writes⟨line · commit ⟨records · ∀ act ⟨green ∨ red ∨ plan-close⟩⟩ · ledger ⟨whole ∨ broke⟩⟩ ⟨unit ≜ assay-verdict achieved · line ≜ integration-line ⟨cut ↾
|
|
29
|
+
export const integrator = `integrator ≜ reads⟨unit · commit · line · records ⟨∀ worktree ∧ local-branch⟩⟩ → writes⟨line · commit ⟨records · ∀ act ⟨green ∨ red ∨ plan-close⟩⟩ · ledger ⟨whole ∨ broke⟩⟩ ⟨unit ≜ assay-verdict achieved · line ≜ integration-line ⟨cut @ bind ⟨planner⟩ ↾ HEAD ⟨bind-checkout⟩ ¬ main · holds ∀ approved-unit ∧ ∀ record ⟨written-during-plan⟩⟩⟩
|
|
29
30
|
stratum ≜ intent ≺ C ≺ spec ≺ artifact ⟨≺ ≜ more-abstract-than · C ≜ durative-concept-lattice⟩
|
|
30
31
|
takes ⟨unit ↾ achieved⟩ · ¬takes ⟨unit ¬ achieved⟩
|
|
31
|
-
reserves ⟨
|
|
32
|
+
reserves ⟨find ⟨line ⟨cut @ bind · ∄ cut @ integrator⟩⟩ · combine ⟨unit ⇒ line⟩ · whole-check ⟨project-full-check ↾ combined-tree · ONCE ∀ combination · ∄ check @ ⟨implementer ∨ assayer⟩⟩ · commit ⟨records ⟨plan ⟨plan-state included⟩ · design · note⟩ ⟨line-worktree holds ∧ lacks(line) ↾ ∀ worktree ∧ local-branch⟩ · pathspec · ∀ act ⟨green ∨ red ∨ plan-close⟩⟩ · report ⟨green ↦ whole(unit) · red ∨ merge-conflict ↦ ⟨unit · failing-check⟩⟩ · ask ⟨operator ⇒ release(line → main)⟩ ⟨architect ↦ plan-close · ≺ records ∈ line⟩⟩
|
|
32
33
|
red ∨ merge-conflict ⇒ work(unit) ∉ line ∧ records ∈ line ⟨records written-meanwhile committed · report ↦ architect ↦ implementer(unit)⟩
|
|
33
34
|
records ⟨green ↦ whole(unit) ⟨line-commit⟩ · red ∨ merge-conflict ↦ broke(unit) ⟨failing-check⟩⟩ ≺ report ⟨completed(unit) ∈ planner⟩
|
|
34
35
|
writes ≠ artifact ⇒ ∄ write ⟨source · config⟩ @ integrator ⟨combine ≠ author · check ≠ repair⟩
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrator.js","sourceRoot":"","sources":["../../../src/dimensions/role/integrator.ts"],"names":[],"mappings":"AAEA,yFAAyF;AACzF,qFAAqF;AACrF,0FAA0F;AAC1F,
|
|
1
|
+
{"version":3,"file":"integrator.js","sourceRoot":"","sources":["../../../src/dimensions/role/integrator.ts"],"names":[],"mappings":"AAEA,yFAAyF;AACzF,qFAAqF;AACrF,0FAA0F;AAC1F,wFAAwF;AACxF,mFAAmF;AACnF,0FAA0F;AAC1F,gFAAgF;AAChF,kDAAkD;AAClD,wFAAwF;AACxF,oBAAoB;AACpB,EAAE;AACF,yFAAyF;AACzF,sFAAsF;AACtF,yFAAyF;AACzF,gFAAgF;AAChF,yFAAyF;AACzF,sCAAsC;AACtC,EAAE;AACF,qFAAqF;AACrF,yFAAyF;AACzF,yFAAyF;AACzF,0CAA0C;AAC1C,EAAE;AACF,wFAAwF;AACxF,yFAAyF;AACzF,0FAA0F;AAC1F,yFAAyF;AACzF,6EAA6E;AAE7E,MAAM,CAAC,MAAM,UAAU,GAAS;;;;;;;oIAOoG,CAAC"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
// waves rest on.
|
|
5
5
|
//
|
|
6
6
|
// THE PLAN IS THIS ROLE'S, START TO END. It takes the shards the architect hands down,
|
|
7
|
-
// plans them, binds the plan when none is bound
|
|
7
|
+
// plans them, binds the plan when none is bound (bind cuts the plan's line, where every
|
|
8
|
+
// record about the plan is then written), moves each unit's state as work reaches
|
|
8
9
|
// it, closes the plan, and answers a stop by rectifying or rebuilding. What it returns to
|
|
9
10
|
// the architect is names and nothing else: the architect never reads behind a name, so a
|
|
10
11
|
// plan view or a spec that leaked upward would put the substrate back in the design-holder's
|
|
@@ -17,8 +18,8 @@
|
|
|
17
18
|
// plan is re-planned here; it is never the planner that changes the design.
|
|
18
19
|
export const planner = `planner ≜ reads⟨C · artifact⟩ → writes⟨spec · plan-records⟩
|
|
19
20
|
stratum ≜ intent ≺ C ≺ spec ≺ artifact ⟨≺ ≜ more-abstract-than · C ≜ durative-concept-lattice⟩
|
|
20
|
-
plan-records ≜ ⟨unit · dependency · state · plan-state⟩
|
|
21
|
-
reserves ⟨census ⟨extant · references · resolved-by-use ¬ by-declaration⟩ · decompose ⟨shards ↦ MECE-units · unit ⇀ ONE shard · deps FIRST · effort(unit) ≤ capacity · how-per-harness ⟨plan-owned ¬ shard-owned⟩⟩ · realizes ⟨unit ⇀ anchor⟩ · sequence ⟨waves ⊨ disjoint-outputs⟩ · bind ⟨@ ratification ∧ ∄ plan-bound⟩ · record ⟨ready-unit ↦ active @ name-handed-out · unit ↦ completed @ whole⟩ · close ⟨∀ unit completed⟩ · rectify ∨ rebuild ⟨plan @ stop⟩ · reconcile ⟨plans ∧ units⟩⟩
|
|
21
|
+
plan-records ≜ ⟨unit · dependency · state · plan-state⟩ ⟨bound plan ↦ written @ plan-line ∀ checkout · committed ∈ integrator ¬ planner⟩
|
|
22
|
+
reserves ⟨census ⟨extant · references · resolved-by-use ¬ by-declaration⟩ · decompose ⟨shards ↦ MECE-units · unit ⇀ ONE shard · deps FIRST · effort(unit) ≤ capacity · how-per-harness ⟨plan-owned ¬ shard-owned⟩⟩ · realizes ⟨unit ⇀ anchor⟩ · sequence ⟨waves ⊨ disjoint-outputs⟩ · bind ⟨@ ratification ∧ ∄ plan-bound · cuts line ↾ HEAD ⟨bind-checkout⟩ ¬ main⟩ · record ⟨ready-unit ↦ active @ name-handed-out · unit ↦ completed @ whole⟩ · close ⟨∀ unit completed⟩ · rectify ∨ rebuild ⟨plan @ stop⟩ · reconcile ⟨plans ∧ units⟩⟩
|
|
22
23
|
returns ⟨plan-name ∧ ready-unit-names⟩ ∧ ¬ spec ∨ plan-view ⟨name ≜ address · architect ¬ reads behind⟩
|
|
23
24
|
state(unit) ∨ state(plan) moves ⊨ planner ⟨bind ∨ close ∨ advance · ∄ move @ implementer ∨ architect⟩
|
|
24
25
|
writes ≠ C ⇒ shard GIVEN ⟨shard ¬ plannable ⇒ SURFACED ¬ redrawn · wrong-shard ⇒ plan re-planned ¬ design changed⟩
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner.js","sourceRoot":"","sources":["../../../src/dimensions/role/planner.ts"],"names":[],"mappings":"AAEA,oFAAoF;AACpF,oFAAoF;AACpF,mFAAmF;AACnF,iBAAiB;AACjB,EAAE;AACF,uFAAuF;AACvF,
|
|
1
|
+
{"version":3,"file":"planner.js","sourceRoot":"","sources":["../../../src/dimensions/role/planner.ts"],"names":[],"mappings":"AAEA,oFAAoF;AACpF,oFAAoF;AACpF,mFAAmF;AACnF,iBAAiB;AACjB,EAAE;AACF,uFAAuF;AACvF,wFAAwF;AACxF,kFAAkF;AAClF,0FAA0F;AAC1F,yFAAyF;AACzF,6FAA6F;AAC7F,SAAS;AACT,EAAE;AACF,qFAAqF;AACrF,mFAAmF;AACnF,sFAAsF;AACtF,sFAAsF;AACtF,4EAA4E;AAE5E,MAAM,CAAC,MAAM,OAAO,GAAS;;;;;;;yEAO4C,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { stanceGuardrailJudgeClip } from './stance-guardrail.js';
|
|
1
2
|
// purview-guardrail — the gate that makes a ROLE CONTRACT scoreable.
|
|
2
3
|
//
|
|
3
4
|
// A role value now states the arrow the position is over the ladder
|
|
@@ -197,6 +198,8 @@ contract="$(awk '/^## Role$/{f=1;next} /^## /{f=0} f' "$AGENT_MD" 2>/dev/null ||
|
|
|
197
198
|
# gate from inventing a law for a corpus that has not declared one.
|
|
198
199
|
[ "$(printf '%s\\n' "$contract" | grep -c '[^[:space:]]')" -ge 2 ] || allow
|
|
199
200
|
|
|
201
|
+
${stanceGuardrailJudgeClip}
|
|
202
|
+
|
|
200
203
|
# --- extract the judged payload, branched by act ---------------------------------------------
|
|
201
204
|
tool_name="$(printf '%s' "$input" | jq -r '.tool_name // empty' 2>/dev/null || true)"
|
|
202
205
|
[ -n "$tool_name" ] || open "the payload names no tool, so there is no call to judge"
|
|
@@ -220,11 +223,19 @@ esac
|
|
|
220
223
|
|
|
221
224
|
[ -n "\${body:-}" ] || allow
|
|
222
225
|
|
|
223
|
-
|
|
226
|
+
# THE JUDGE IS SENT AT MOST JUDGE_PAYLOAD_CAP BYTES, the declared contract and the act included.
|
|
227
|
+
# The contract is a role section a few kilobytes long, so it may hold half the cap at most; the
|
|
228
|
+
# dispatch prompt takes what is left, keeping both ends because its instruction may sit at either,
|
|
229
|
+
# and the seam is marked. The evidence check below then runs against exactly this payload, so a
|
|
230
|
+
# span in text the excerpt elided is discarded like any span that is not there.
|
|
231
|
+
contract="$(printf '%s' "$contract" | judge_ends "$((JUDGE_PAYLOAD_CAP / 2))")"
|
|
232
|
+
head_part="=== THE HOLDER'S DECLARED CONTRACT (agent: $agent_type) ===
|
|
224
233
|
$contract
|
|
225
234
|
=== THE ACT ABOUT TO FIRE ===
|
|
226
235
|
$act
|
|
227
|
-
|
|
236
|
+
"
|
|
237
|
+
body="$(printf '%s' "$body" | judge_ends "$((JUDGE_PAYLOAD_CAP - $(judge_bytes "$head_part")))")"
|
|
238
|
+
payload="$head_part$body"
|
|
228
239
|
|
|
229
240
|
# --- loop-safety: never deny an identical tool_input twice ----------------------------------
|
|
230
241
|
session_id="$(printf '%s' "$input" | jq -r '.session_id // "nosession"' 2>/dev/null || echo nosession)"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purview-guardrail.js","sourceRoot":"","sources":["../../src/hooks/purview-guardrail.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"purview-guardrail.js","sourceRoot":"","sources":["../../src/hooks/purview-guardrail.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,qEAAqE;AACrE,EAAE;AACF,oEAAoE;AACpE,oFAAoF;AACpF,mFAAmF;AACnF,kFAAkF;AAClF,qBAAqB;AACrB,EAAE;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoGzB;SACI;QACD;YACE,QAAQ,EAAE,yBAAyB;YACnC,UAAU,EAAE,0DAA0D;YACtE,UAAU,EAAE,KAAK;YACjB,iFAAiF;YACjF,2EAA2E;YAC3E,6EAA6E;YAC7E,8EAA8E;YAC9E,6BAA6B;YAC7B,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwFd;SACI;KACF;CACF,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { anchorOf } from '@cratylus/schema';
|
|
2
2
|
import { handoff } from '../dimensions/autonomy/handoff.js';
|
|
3
|
+
import { stanceGuardrailJudgeClip } from './stance-guardrail.js';
|
|
3
4
|
// stance-guardrail-pre — the BEFORE-THE-CALL twin of `stance-guardrail` (the turn-end
|
|
4
5
|
// cell). It STRUCTURALLY REFUSES, BEFORE the call fires, a mid-turn tool call that
|
|
5
6
|
// collapses out of the intent-driven-expert stance. Two acts, and the acts are what it
|
|
@@ -180,6 +181,8 @@ manifest="$stance_scope/{{fact:stance-manifest}}"
|
|
|
180
181
|
[ -f "$manifest" ] || allow
|
|
181
182
|
agent_type="$(jq -r '.agent // empty' "$manifest" 2>/dev/null || true)"
|
|
182
183
|
|
|
184
|
+
${stanceGuardrailJudgeClip}
|
|
185
|
+
|
|
183
186
|
# --- extract the judged payload, branched by tool -------------------------------------------
|
|
184
187
|
tool_name="$(printf '%s' "$input" | jq -r '.tool_name // empty' 2>/dev/null || true)"
|
|
185
188
|
[ -n "$tool_name" ] || open "the payload names no tool, so there is no call to judge"
|
|
@@ -193,11 +196,11 @@ case "$tool_name" in
|
|
|
193
196
|
+ " OPTIONS: " + ((.options // []) | map(.label // "") | join(" | ")))
|
|
194
197
|
| join(" ;; ")
|
|
195
198
|
' 2>/dev/null || true)"
|
|
196
|
-
|
|
199
|
+
prefix="AskUserQuestion menu (a question/option menu handed to the operator): " ;;
|
|
197
200
|
Agent|SendMessage)
|
|
198
201
|
# the dispatch prompt/message — the dispatch-echo class
|
|
199
202
|
body="$(printf '%s' "$input" | jq -r '.tool_input.prompt // .tool_input.message // .tool_input.description // ""' 2>/dev/null || true)"
|
|
200
|
-
|
|
203
|
+
prefix="$tool_name dispatch (the delegate prompt/message): " ;;
|
|
201
204
|
*)
|
|
202
205
|
allow ;; # DEFENCE IN DEPTH: every supported adapter computes a selector from the
|
|
203
206
|
# act, so this never fires there. A harness that could fire the act but
|
|
@@ -207,6 +210,12 @@ esac
|
|
|
207
210
|
|
|
208
211
|
[ -n "\${body:-}" ] || allow # nothing judgeable -> allow
|
|
209
212
|
|
|
213
|
+
# THE JUDGE IS SENT AT MOST JUDGE_PAYLOAD_CAP BYTES, prefix included: a menu or a dispatch prompt
|
|
214
|
+
# has no bound of its own, and a judgement has to fit the time the harness allows a guard. The
|
|
215
|
+
# instruction of a prompt may sit at either end, so both ends are kept and the seam is marked.
|
|
216
|
+
body="$(printf '%s' "$body" | judge_ends "$((JUDGE_PAYLOAD_CAP - $(judge_bytes "$prefix")))")"
|
|
217
|
+
payload="$prefix$body"
|
|
218
|
+
|
|
210
219
|
# --- loop-safety: never deny an identical tool_input twice ----------------------------------
|
|
211
220
|
# No stop_hook_active analog exists for PreToolUse; a per-(session,input) marker caps re-deny.
|
|
212
221
|
session_id="$(printf '%s' "$input" | jq -r '.session_id // "nosession"' 2>/dev/null || echo nosession)"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stance-guardrail-pre.js","sourceRoot":"","sources":["../../src/hooks/stance-guardrail-pre.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"st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