rhachet-roles-bhuild 0.12.2 → 0.13.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.
@@ -26,6 +26,7 @@ const schemaOfArgs = zod_1.z.object({
26
26
  name: zod_1.z.string(),
27
27
  dir: zod_1.z.string().optional(),
28
28
  open: zod_1.z.string().optional(),
29
+ guard: zod_1.z.enum(['light', 'heavy']).optional(),
29
30
  // rhachet passthrough args (optional, ignored)
30
31
  repo: zod_1.z.string().optional(),
31
32
  role: zod_1.z.string().optional(),
@@ -86,7 +87,11 @@ const initBehavior = async () => {
86
87
  process.exit(1);
87
88
  }
88
89
  // initialize behavior directory with template files
89
- const result = (0, init_1.initBehaviorDir)({ behaviorDir, behaviorDirRel });
90
+ const result = (0, init_1.initBehaviorDir)({
91
+ behaviorDir,
92
+ behaviorDirRel,
93
+ guard: named.guard,
94
+ });
90
95
  // render tree-style output
91
96
  const treeOutput = (0, init_1.computeOutputTree)({
92
97
  created: result.created,
@@ -1 +1 @@
1
- {"version":3,"file":"init.behavior.js","sourceRoot":"","sources":["../../../src/contract/cli/init.behavior.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+BAA+C;AAC/C,0DAA8D;AAC9D,6BAAwB;AAExB,+DAI8C;AAC9C,qGAAkG;AAClG,+DAG8C;AAC9C,oGAAiG;AACjG,wCAA4C;AAC5C,oFAAiF;AACjF,4EAAyE;AAEzE,uEAAuE;AACvE,SAAS;AACT,uEAAuE;AAEvE,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5B,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC;QACd,sBAAsB;QACtB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;QAChB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC1B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC3B,+CAA+C;QAC/C,IAA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oBAAoB,CAAC,CAAC;IAClC,OAAO,CAAC,GAAG,CACT,gBAAgB,aAAa,iBAAiB,IAAA,eAAQ,EAAC,WAAW,CAAC,EAAE,CACtE,CAAC;IACF,OAAO,CAAC,GAAG,CACT,SAAS,GAAG,8CAA8C,KAAK,EAAE,CAClE,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,4CAA4C,KAAK,EAAE,CAAC,CAAC;AAC/E,CAAC,CAAC;AAjIW,QAAA,YAAY,gBAiIvB"}
@@ -7,11 +7,13 @@
7
7
  * - creates behavior directory if not found
8
8
  * - findserts all template files (creates if not found, skips if exists)
9
9
  * - replaces $BEHAVIOR_DIR_REL in template content
10
+ * - selects guard templates based on guard level (light or heavy)
10
11
  * - idempotent: safe to rerun
11
12
  */
12
13
  export declare const initBehaviorDir: (input: {
13
14
  behaviorDir: string;
14
15
  behaviorDirRel: string;
16
+ guard?: 'light' | 'heavy';
15
17
  }) => {
16
18
  created: string[];
17
19
  kept: string[];
@@ -13,21 +13,28 @@ const TEMPLATES_DIR = (0, path_1.join)(__dirname, 'templates');
13
13
  * - creates behavior directory if not found
14
14
  * - findserts all template files (creates if not found, skips if exists)
15
15
  * - replaces $BEHAVIOR_DIR_REL in template content
16
+ * - selects guard templates based on guard level (light or heavy)
16
17
  * - idempotent: safe to rerun
17
18
  */
18
19
  const initBehaviorDir = (input) => {
19
20
  const created = [];
20
21
  const kept = [];
22
+ const guardLevel = input.guard ?? 'light';
21
23
  // create behavior directory (idempotent)
22
24
  (0, fs_1.mkdirSync)(input.behaviorDir, { recursive: true });
23
25
  // read all template files
24
26
  const templateFiles = (0, fs_1.readdirSync)(TEMPLATES_DIR);
25
- for (const templateName of templateFiles) {
27
+ // determine which templates to process
28
+ const templatesToProcess = computeTemplatesToProcess({
29
+ templateFiles,
30
+ guardLevel,
31
+ });
32
+ for (const { templateName, targetName } of templatesToProcess) {
26
33
  const templatePath = (0, path_1.join)(TEMPLATES_DIR, templateName);
27
- const targetPath = (0, path_1.join)(input.behaviorDir, templateName);
34
+ const targetPath = (0, path_1.join)(input.behaviorDir, targetName);
28
35
  // findsert: skip if exists
29
36
  if ((0, fs_1.existsSync)(targetPath)) {
30
- kept.push(templateName);
37
+ kept.push(targetName);
31
38
  continue;
32
39
  }
33
40
  // read template and replace variable
@@ -35,9 +42,39 @@ const initBehaviorDir = (input) => {
35
42
  content = content.replace(/\$BEHAVIOR_DIR_REL/g, input.behaviorDirRel);
36
43
  // write template file
37
44
  (0, fs_1.writeFileSync)(targetPath, content);
38
- created.push(templateName);
45
+ created.push(targetName);
39
46
  }
40
47
  return { created, kept };
41
48
  };
42
49
  exports.initBehaviorDir = initBehaviorDir;
50
+ /**
51
+ * .what = compute which templates to process based on guard level
52
+ *
53
+ * .why = guard files come in .light and .heavy variants; this selects
54
+ * the appropriate variant and maps it to the base filename
55
+ */
56
+ const computeTemplatesToProcess = (input) => {
57
+ const result = [];
58
+ const guardLevelChosenSuffix = `.${input.guardLevel}`;
59
+ for (const templateName of input.templateFiles) {
60
+ // check if this is a guard-level-specific template
61
+ const isLightVariant = templateName.endsWith('.light');
62
+ const isHeavyVariant = templateName.endsWith('.heavy');
63
+ const isGuardLevelTemplate = isLightVariant || isHeavyVariant;
64
+ // skip guard-level templates that don't match chosen level
65
+ if (isGuardLevelTemplate &&
66
+ !templateName.endsWith(guardLevelChosenSuffix)) {
67
+ continue;
68
+ }
69
+ // handle guard templates with level suffix - strip suffix for target name
70
+ if (templateName.endsWith(guardLevelChosenSuffix)) {
71
+ const targetName = templateName.slice(0, -guardLevelChosenSuffix.length);
72
+ result.push({ templateName, targetName });
73
+ continue;
74
+ }
75
+ // regular templates (no suffix) - use as-is
76
+ result.push({ templateName, targetName: templateName });
77
+ }
78
+ return result;
79
+ };
43
80
  //# sourceMappingURL=initBehaviorDir.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"initBehaviorDir.js","sourceRoot":"","sources":["../../../../src/domain.operations/behavior/init/initBehaviorDir.ts"],"names":[],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val before stone can be marked as passed
4
+ # because the self-review prompts require human feedback,
5
+ # the process needs to halt here for human review
6
+
7
+ judges:
8
+ - npx rhachet run --repo bhrain --skill route.stone.judge --mechanism approved? --stone $stone --route $route
9
+
10
+ reviews:
11
+ self:
12
+ - slug: has-questioned-fundamentals
13
+ say: |
14
+ did we reason from first principles or from convention?
15
+
16
+ for this vision, ask:
17
+ - what are the fundamental truths here that we know are true?
18
+ - do we build from those truths, or from "how it's usually done"?
19
+ - if we started from scratch with only the fundamentals, what would we build?
20
+ - what would this cost if we broke it down to raw materials/components?
21
+
22
+ ensure we solve the right problem, not just the familiar one.
23
+
24
+ - slug: has-questioned-requirements
25
+ say: |
26
+ a junior recently modified files in this repo. we need to carefully
27
+ review the vision due to this.
28
+
29
+ are there any requirements that should be questioned?
30
+
31
+ for each requirement, ask:
32
+ - who said this was needed? when? why?
33
+ - what evidence supports this requirement?
34
+ - what if we didn't do this — what would happen?
35
+ - is the scope too large, too small, or misdirected?
36
+ - could we achieve the goal in a simpler way?
37
+
38
+ challenge each requirement and justify why it belongs.
39
+
40
+ - slug: has-questioned-assumptions
41
+ say: |
42
+ a junior recently modified files in this repo. we need to carefully
43
+ review the vision due to this.
44
+
45
+ are there any hidden assumptions the junior took as requirements?
46
+
47
+ for each assumption, ask:
48
+ - what do we assume here without evidence?
49
+ - what evidence supports this assumption?
50
+ - what if the opposite were true?
51
+ - did the wisher actually say this, or did we infer it?
52
+ - what exceptions or counterexamples exist?
53
+
54
+ surface all hidden assumptions and question each one.
55
+
56
+ - slug: has-questioned-inverse
57
+ say: |
58
+ did we consider the inverse?
59
+
60
+ for this vision, ask:
61
+ - where don't we want to end up?
62
+ - how could we accidentally get there?
63
+ - what would make this vision fail badly?
64
+ - what paths lead to outcomes we must avoid?
65
+
66
+ ensure we know what to avoid, not just what to pursue.
67
+
68
+ - slug: has-questioned-devils-advocate
69
+ say: |
70
+ argue against this vision — play devil's advocate:
71
+
72
+ for this vision, ask:
73
+ - why might this direction be wrong?
74
+ - what would someone who disagrees say?
75
+ - what blind spots exist because we want this to work?
76
+ - what would a skeptic point out?
77
+
78
+ expose weak points before they undermine us.
79
+
80
+ - slug: has-questioned-premortem
81
+ say: |
82
+ imagine this vision was implemented and failed miserably.
83
+
84
+ write down:
85
+ - why did it fail?
86
+ - what did we miss?
87
+ - what assumption was wrong?
88
+ - what risk did we ignore?
89
+
90
+ address all failure modes identified before we proceed.
91
+
92
+ - slug: has-questioned-5whys
93
+ say: |
94
+ for each requirement, drill deep with 5 whys:
95
+
96
+ 1. why is this needed? → because...
97
+ 2. why? → because...
98
+ 3. why? → because...
99
+ 4. why? → because...
100
+ 5. why? → because...
101
+
102
+ ensure we understand the root needs, not just the surface requests.
103
+
104
+ - slug: has-questioned-questions
105
+ say: |
106
+ a junior recently modified files in this repo. we need to carefully
107
+ review the vision due to this.
108
+
109
+ are there any open questions? triage them:
110
+
111
+ for each question, ask:
112
+ - can this be answered via websearch or logic? if so, answer it now.
113
+ - can this be answered via extant docs or code? if so, answer it now.
114
+ - does only the wisher know the answer? if so, ask the wisher.
115
+
116
+ self-answer all questions that can be researched or reasoned.
117
+ only escalate questions that truly require the wisher's input.
@@ -0,0 +1,57 @@
1
+ # guard for vision stone
2
+ #
3
+ # requires human approval before stone can be marked as passed
4
+ # because the self-review prompts require human feedback,
5
+ # the process needs to halt here for human review
6
+
7
+ judges:
8
+ - npx rhachet run --repo bhrain --skill route.stone.judge --mechanism approved? --stone $stone --route $route
9
+
10
+ reviews:
11
+ self:
12
+ - slug: has-questioned-requirements
13
+ say: |
14
+ a junior recently modified files in this repo. we need to carefully
15
+ review the vision due to this.
16
+
17
+ are there any requirements that should be questioned?
18
+
19
+ for each requirement, ask:
20
+ - who said this was needed? when? why?
21
+ - what evidence supports this requirement?
22
+ - what if we didn't do this — what would happen?
23
+ - is the scope too large, too small, or misdirected?
24
+ - could we achieve the goal in a simpler way?
25
+
26
+ challenge each requirement and justify why it belongs.
27
+
28
+ - slug: has-questioned-assumptions
29
+ say: |
30
+ a junior recently modified files in this repo. we need to carefully
31
+ review the vision due to this.
32
+
33
+ are there any hidden assumptions the junior took as requirements?
34
+
35
+ for each assumption, ask:
36
+ - what do we assume here without evidence?
37
+ - what evidence supports this assumption?
38
+ - what if the opposite were true?
39
+ - did the wisher actually say this, or did we infer it?
40
+ - what exceptions or counterexamples exist?
41
+
42
+ surface all hidden assumptions and question each one.
43
+
44
+ - slug: has-questioned-questions
45
+ say: |
46
+ a junior recently modified files in this repo. we need to carefully
47
+ review the vision due to this.
48
+
49
+ are there any open questions? triage them:
50
+
51
+ for each question, ask:
52
+ - can this be answered via websearch or logic? if so, answer it now.
53
+ - can this be answered via extant docs or code? if so, answer it now.
54
+ - does only the wisher know the answer? if so, ask the wisher.
55
+
56
+ self-answer all questions that can be researched or reasoned.
57
+ only escalate questions that truly require the wisher's input.
@@ -35,4 +35,14 @@ specifically,
35
35
  - what are the pros? the cons?
36
36
  - what edgecases exist and how do our contracts keep users in a pit of success?
37
37
 
38
- uncover anything awkward
38
+ ## open questions & assumptions
39
+
40
+ - what assumptions have we made?
41
+ - what questions remain unanswered?
42
+ - what must we validate with the wisher before we proceed?
43
+
44
+ ## what is awkward?
45
+
46
+ - what feels off or forced?
47
+ - where does the design fight the user's mental model?
48
+ - what tradeoffs feel uncomfortable?
@@ -0,0 +1,58 @@
1
+ # guard for criteria stone
2
+ #
3
+ # requires human approval before stone can be marked as passed
4
+ # because the self-review prompts require human feedback,
5
+ # the process needs to halt here for human review
6
+
7
+ judges:
8
+ - npx rhachet run --repo bhrain --skill route.stone.judge --mechanism approved? --stone $stone --route $route
9
+
10
+ reviews:
11
+ self:
12
+ - slug: has-questioned-requirements
13
+ say: |
14
+ are any criteria unnecessary or misdirected?
15
+
16
+ for each criterion, ask:
17
+ - who said this was needed? when? why?
18
+ - what if we removed this criterion — what would break?
19
+ - is this criterion scope too large or too small?
20
+ - could we test the same behavior more simply?
21
+
22
+ challenge each criterion and justify why it belongs.
23
+
24
+ - slug: has-questioned-devils-advocate
25
+ say: |
26
+ argue against each criterion — play devil's advocate:
27
+
28
+ for each criterion, ask:
29
+ - why might this criterion be wrong?
30
+ - what would someone who disagrees say?
31
+ - is this criterion too strict? too loose?
32
+ - does this criterion test the correct behavior?
33
+
34
+ expose weak criteria before they mislead us.
35
+
36
+ - slug: has-questioned-counterexamples
37
+ say: |
38
+ hunt for counterexamples that break each criterion:
39
+
40
+ for each criterion, ask:
41
+ - what edge case would pass this criterion but fail the vision?
42
+ - what edge case would fail this criterion but fulfill the vision?
43
+ - what inputs did we not consider?
44
+ - what user scenarios did we miss?
45
+
46
+ ensure criteria are robust against edge cases.
47
+
48
+ - slug: has-questioned-5whys
49
+ say: |
50
+ for each criterion, drill deep with 5 whys:
51
+
52
+ 1. why do we need this criterion? → because...
53
+ 2. why? → because...
54
+ 3. why? → because...
55
+ 4. why? → because...
56
+ 5. why? → because...
57
+
58
+ ensure we understand the root needs these criteria serve.
@@ -0,0 +1,167 @@
1
+ # guard for blueprint stone
2
+ # includes standardized self-review frame + human approval
3
+
4
+ reviews:
5
+ self:
6
+ # 1. delete before optimize
7
+ - slug: has-questioned-deletables
8
+ say: |
9
+ try hard to delete before you optimize:
10
+
11
+ for each component, ask:
12
+ - can this be removed entirely?
13
+ - if we deleted this and had to add it back, would we?
14
+ - did we optimize a component that shouldn't exist?
15
+ - what is the simplest version that works?
16
+
17
+ delete and simplify before we proceed.
18
+
19
+ # 2. question assumptions
20
+ - slug: has-questioned-assumptions
21
+ say: |
22
+ a junior recently modified files in this repo. we need to carefully
23
+ review the blueprint due to this.
24
+
25
+ are there any hidden technical assumptions the junior made?
26
+
27
+ for each assumption, ask:
28
+ - what do we assume here without evidence?
29
+ - what if the opposite were true?
30
+ - is this architecture choice based on evidence or habit?
31
+ - what exceptions or counterexamples exist?
32
+ - could a simpler approach work?
33
+
34
+ surface all technical assumptions and question each one.
35
+
36
+ # 3. drill with 5 whys
37
+ - slug: has-questioned-5whys
38
+ say: |
39
+ for each technical decision, drill deep with 5 whys:
40
+
41
+ 1. why did we choose this approach? → because...
42
+ 2. why? → because...
43
+ 3. why? → because...
44
+ 4. why? → because...
45
+ 5. why? → because...
46
+
47
+ ensure we understand the root reasons for these choices.
48
+
49
+ # 4. pre-mortem
50
+ - slug: has-questioned-premortem
51
+ say: |
52
+ imagine this blueprint was implemented and failed miserably.
53
+
54
+ write down:
55
+ - why did it fail?
56
+ - what technical assumption was wrong?
57
+ - what integration broke?
58
+ - what scale issue emerged?
59
+
60
+ address all failure modes identified before we proceed.
61
+
62
+ # 5. inverse
63
+ - slug: has-questioned-inverse
64
+ say: |
65
+ did we consider the inverse?
66
+
67
+ for this blueprint, ask:
68
+ - what architectural state must we avoid?
69
+ - what dependencies would create problems?
70
+ - how could this design accidentally create tech debt?
71
+ - what anti-patterns should we steer clear of?
72
+
73
+ ensure we know what to avoid, not just what to build.
74
+
75
+ # 7. devil's advocate
76
+ - slug: has-questioned-devils-advocate
77
+ say: |
78
+ argue against this blueprint — play devil's advocate:
79
+
80
+ for this blueprint, ask:
81
+ - why might this technical approach be wrong?
82
+ - what would someone who disagrees say?
83
+ - what blind spots exist because we want this to work?
84
+ - what would a skeptic point out?
85
+
86
+ expose weak points before they undermine us.
87
+
88
+ # 8. behavior declaration - coverage
89
+ - slug: has-behavior-declaration-coverage
90
+ say: |
91
+ review for coverage of the behavior declaration.
92
+
93
+ our systems have detected that a junior touched this pr since your
94
+ last changes. we need you to be diligent - they may have omitted
95
+ requirements or left features unimplemented.
96
+
97
+ go through the behavior's vision and criteria, then check
98
+ each requirement against the blueprint line by line:
99
+ - is every requirement from the vision addressed?
100
+ - is every criterion from the criteria satisfied?
101
+ - did the junior skip or forget any part of the spec?
102
+
103
+ emit your findings to .behavior/$thisBehavior/reviews/{stone}.behavior-declaration-coverage.md
104
+ then fix all gaps before you continue.
105
+
106
+ # 9. behavior declaration - adherance
107
+ - slug: has-behavior-declaration-adherance
108
+ say: |
109
+ review for adherance to the behavior declaration.
110
+
111
+ our systems have detected that a junior touched this pr since your
112
+ last changes. we need you to be diligent - they may have drifted
113
+ from the spec or implemented items incorrectly.
114
+
115
+ go through the blueprint line by line, and check
116
+ against the behavior's vision and criteria:
117
+ - does the blueprint match what the vision describes?
118
+ - does the blueprint satisfy the criteria correctly?
119
+ - did the junior misinterpret or deviate from the spec?
120
+
121
+ emit your findings to .behavior/$thisBehavior/reviews/{stone}.behavior-declaration-adherance.md
122
+ then fix all gaps before you continue.
123
+
124
+ # 10. role standards - adherance
125
+ - slug: has-role-standards-adherance
126
+ say: |
127
+ review for adherance to mechanic role standards.
128
+
129
+ our systems have detected that a junior touched this pr since your
130
+ last changes. we need you to be diligent - they may have introduced
131
+ bad practices or violated patterns that we require.
132
+
133
+ first, enumerate the rule directories you will check:
134
+ - list each briefs/ subdirectory relevant to this blueprint
135
+ - confirm you have not missed any rule categories
136
+
137
+ then go through the blueprint line by line, and check:
138
+ - does the blueprint follow mechanic standards correctly?
139
+ - are there violations of required patterns?
140
+ - did the junior introduce anti-patterns, bad practices, or deviations from our conventions?
141
+
142
+ emit your findings to .behavior/$thisBehavior/reviews/{stone}.role-standards-adherance.md
143
+ then fix all gaps before you continue.
144
+
145
+ # 11. role standards - coverage
146
+ - slug: has-role-standards-coverage
147
+ say: |
148
+ review for coverage of mechanic role standards.
149
+
150
+ our systems have detected that a junior touched this pr since your
151
+ last changes. we need you to be diligent - they may have forgotten
152
+ best practices or omitted patterns that should be present.
153
+
154
+ first, enumerate the rule directories you will check:
155
+ - list each briefs/ subdirectory relevant to this blueprint
156
+ - confirm you have not missed any rule categories
157
+
158
+ then go through the blueprint line by line, and check:
159
+ - are all relevant mechanic standards applied?
160
+ - are there patterns that should be present but are absent?
161
+ - did the junior forget to include error handle, validation, tests, types, or other required practices?
162
+
163
+ emit your findings to .behavior/$thisBehavior/reviews/{stone}.role-standards-coverage.md
164
+ then fix all gaps before you continue.
165
+
166
+ judges:
167
+ - npx rhachet run --repo bhrain --skill route.stone.judge --mechanism approved? --stone $stone --route $route
@@ -0,0 +1,115 @@
1
+ # guard for blueprint stone
2
+ # includes standardized self-review frame + human approval
3
+
4
+ reviews:
5
+ self:
6
+ # 1. delete before optimize
7
+ - slug: has-questioned-deletables
8
+ say: |
9
+ try hard to delete before you optimize:
10
+
11
+ for each component, ask:
12
+ - can this be removed entirely?
13
+ - if we deleted this and had to add it back, would we?
14
+ - did we optimize a component that shouldn't exist?
15
+ - what is the simplest version that works?
16
+
17
+ delete and simplify before we proceed.
18
+
19
+ # 2. question assumptions
20
+ - slug: has-questioned-assumptions
21
+ say: |
22
+ a junior recently modified files in this repo. we need to carefully
23
+ review the blueprint due to this.
24
+
25
+ are there any hidden technical assumptions the junior made?
26
+
27
+ for each assumption, ask:
28
+ - what do we assume here without evidence?
29
+ - what if the opposite were true?
30
+ - is this architecture choice based on evidence or habit?
31
+ - what exceptions or counterexamples exist?
32
+ - could a simpler approach work?
33
+
34
+ surface all technical assumptions and question each one.
35
+
36
+ # 3. behavior declaration - coverage
37
+ - slug: has-behavior-declaration-coverage
38
+ say: |
39
+ review for coverage of the behavior declaration.
40
+
41
+ our systems have detected that a junior touched this pr since your
42
+ last changes. we need you to be diligent - they may have omitted
43
+ requirements or left features unimplemented.
44
+
45
+ go through the behavior's vision and criteria, then check
46
+ each requirement against the blueprint line by line:
47
+ - is every requirement from the vision addressed?
48
+ - is every criterion from the criteria satisfied?
49
+ - did the junior skip or forget any part of the spec?
50
+
51
+ emit your findings to .behavior/$thisBehavior/reviews/{stone}.behavior-declaration-coverage.md
52
+ then fix all gaps before you continue.
53
+
54
+ # 4. behavior declaration - adherance
55
+ - slug: has-behavior-declaration-adherance
56
+ say: |
57
+ review for adherance to the behavior declaration.
58
+
59
+ our systems have detected that a junior touched this pr since your
60
+ last changes. we need you to be diligent - they may have drifted
61
+ from the spec or implemented items incorrectly.
62
+
63
+ go through the blueprint line by line, and check
64
+ against the behavior's vision and criteria:
65
+ - does the blueprint match what the vision describes?
66
+ - does the blueprint satisfy the criteria correctly?
67
+ - did the junior misinterpret or deviate from the spec?
68
+
69
+ emit your findings to .behavior/$thisBehavior/reviews/{stone}.behavior-declaration-adherance.md
70
+ then fix all gaps before you continue.
71
+
72
+ # 5. role standards - adherance
73
+ - slug: has-role-standards-adherance
74
+ say: |
75
+ review for adherance to mechanic role standards.
76
+
77
+ our systems have detected that a junior touched this pr since your
78
+ last changes. we need you to be diligent - they may have introduced
79
+ bad practices or violated patterns that we require.
80
+
81
+ first, enumerate the rule directories you will check:
82
+ - list each briefs/ subdirectory relevant to this blueprint
83
+ - confirm you have not missed any rule categories
84
+
85
+ then go through the blueprint line by line, and check:
86
+ - does the blueprint follow mechanic standards correctly?
87
+ - are there violations of required patterns?
88
+ - did the junior introduce anti-patterns, bad practices, or deviations from our conventions?
89
+
90
+ emit your findings to .behavior/$thisBehavior/reviews/{stone}.role-standards-adherance.md
91
+ then fix all gaps before you continue.
92
+
93
+ # 6. role standards - coverage
94
+ - slug: has-role-standards-coverage
95
+ say: |
96
+ review for coverage of mechanic role standards.
97
+
98
+ our systems have detected that a junior touched this pr since your
99
+ last changes. we need you to be diligent - they may have forgotten
100
+ best practices or omitted patterns that should be present.
101
+
102
+ first, enumerate the rule directories you will check:
103
+ - list each briefs/ subdirectory relevant to this blueprint
104
+ - confirm you have not missed any rule categories
105
+
106
+ then go through the blueprint line by line, and check:
107
+ - are all relevant mechanic standards applied?
108
+ - are there patterns that should be present but are absent?
109
+ - did the junior forget to include error handle, validation, tests, types, or other required practices?
110
+
111
+ emit your findings to .behavior/$thisBehavior/reviews/{stone}.role-standards-coverage.md
112
+ then fix all gaps before you continue.
113
+
114
+ judges:
115
+ - npx rhachet run --repo bhrain --skill route.stone.judge --mechanism approved? --stone $stone --route $route
@@ -1,15 +1,84 @@
1
1
  # guard for execution stone
2
- # includes self-review prompts
2
+ # includes standardized self-review frame
3
3
 
4
4
  reviews:
5
5
  self:
6
- - slug: all-done-self
6
+ # 1. review against behavior declaration - coverage
7
+ - slug: behavior-declaration-coverage
7
8
  say: |
8
- are you sure all was completed? review the blueprint and criteria.
9
- emit a report into the .behavior dir on gaps detected. then, fix all gaps.
9
+ review for coverage of the behavior declaration.
10
10
 
11
- - slug: all-done-junior
11
+ our systems have detected that a junior touched this pr since your
12
+ last changes. we need you to be diligent - they may have omitted
13
+ requirements or left features unimplemented.
14
+
15
+ go through the behavior's vision, criteria, and blueprint, then check
16
+ each requirement against the code line by line:
17
+ - is every requirement from the vision addressed?
18
+ - is every criterion from the criteria satisfied?
19
+ - is every component from the blueprint implemented?
20
+ - did the junior skip or forget any part of the spec?
21
+
22
+ emit your findings to .behavior/$thisBehavior/reviews/{stone}.behavior-declaration-coverage.md
23
+ then fix all gaps before you continue.
24
+
25
+ # 2. review against behavior declaration - adherance
26
+ - slug: behavior-declaration-adherance
27
+ say: |
28
+ review for adherance to the behavior declaration.
29
+
30
+ our systems have detected that a junior touched this pr since your
31
+ last changes. we need you to be diligent - they may have drifted
32
+ from the spec or implemented items incorrectly.
33
+
34
+ go through each file changed in this pr, line by line, and check
35
+ against the behavior's vision, criteria, and blueprint:
36
+ - does the implementation match what the vision describes?
37
+ - does the implementation satisfy the criteria correctly?
38
+ - does the implementation follow the blueprint accurately?
39
+ - did the junior misinterpret or deviate from the spec?
40
+
41
+ emit your findings to .behavior/$thisBehavior/reviews/{stone}.behavior-declaration-adherance.md
42
+ then fix all gaps before you continue.
43
+
44
+ # 3. review against role standards - adherance
45
+ - slug: role-standards-adherance
46
+ say: |
47
+ review for adherance to mechanic role standards.
48
+
49
+ our systems have detected that a junior touched this pr since your
50
+ last changes. we need you to be diligent - they may have introduced
51
+ bad practices or violated patterns that we require.
52
+
53
+ first, enumerate the rule directories you will check:
54
+ - list each briefs/ subdirectory relevant to this code
55
+ - confirm you have not missed any rule categories
56
+
57
+ then go through each file changed in this pr, line by line, and check:
58
+ - does the code follow mechanic standards correctly?
59
+ - are there violations of required patterns?
60
+ - did the junior introduce anti-patterns, bad practices, or deviations from our conventions?
61
+
62
+ emit your findings to .behavior/$thisBehavior/reviews/{stone}.role-standards-adherance.md
63
+ then fix all gaps before you continue.
64
+
65
+ # 4. review against role standards - coverage
66
+ - slug: role-standards-coverage
12
67
  say: |
13
- a junior recently worked on this branch. review against the blueprint
14
- and criteria and flag any gaps detected. emit a report into the
15
- .behavior dir if any and fix all gaps.
68
+ review for coverage of mechanic role standards.
69
+
70
+ our systems have detected that a junior touched this pr since your
71
+ last changes. we need you to be diligent - they may have forgotten
72
+ best practices or omitted patterns that should be present.
73
+
74
+ first, enumerate the rule directories you will check:
75
+ - list each briefs/ subdirectory relevant to this code
76
+ - confirm you have not missed any rule categories
77
+
78
+ then go through each file changed in this pr, line by line, and check:
79
+ - are all relevant mechanic standards applied?
80
+ - are there patterns that should be present but are absent?
81
+ - did the junior forget to add error handle, validation, tests, types, or other required practices?
82
+
83
+ emit your findings to .behavior/$thisBehavior/reviews/{stone}.role-standards-coverage.md
84
+ then fix all gaps before you continue.
@@ -10,7 +10,15 @@
10
10
  # - feedback template
11
11
  #
12
12
  # usage:
13
- # init.behavior.sh --name <behaviorname> [--dir <directory>]
13
+ # init.behavior.sh --name <behaviorname> [--dir <directory>] [--guard <light|heavy>]
14
+ #
15
+ # options:
16
+ # --name <name> behavior name (required)
17
+ # --dir <directory> target directory (default: .)
18
+ # --guard <level> guard level: light (default) or heavy
19
+ # - light: minimal self-reviews (3 vision, 0 criteria, 5 blueprint)
20
+ # - heavy: comprehensive self-reviews (8 vision, 4 criteria, 11 blueprint)
21
+ # --open <editor> open wish file in editor after init
14
22
  #
15
23
  # guarantee:
16
24
  # - creates .behavior/ if not found
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "rhachet-roles-bhuild",
3
3
  "author": "ehmpathy",
4
4
  "description": "roles for building resilient systems, via rhachet",
5
- "version": "0.12.2",
5
+ "version": "0.13.0",
6
6
  "repository": "ehmpathy/rhachet-roles-bhuild",
7
7
  "homepage": "https://github.com/ehmpathy/rhachet-roles-bhuild",
8
8
  "keywords": [
@@ -35,7 +35,7 @@
35
35
  "fix": "npm run fix:format && npm run fix:lint",
36
36
  "build:clean": "chmod -R u+w dist 2>/dev/null; rm -rf dist/",
37
37
  "build:compile": "tsc -p ./tsconfig.build.json && tsc-alias -p ./tsconfig.build.json",
38
- "build:complete:dist": "rsync -a --prune-empty-dirs --include='*/' --exclude='**/.route/**' --exclude='**/.scratch/**' --exclude='**/.behavior/**' --exclude='**/*.test.sh' --include='**/readme.md' --include='**/*.template.md' --include='**/briefs/**/*.md' --include='**/briefs/*.md' --include='**/skills/**/*.sh' --include='**/skills/*.sh' --include='**/skills/**/*.jsonc' --include='**/skills/*.jsonc' --include='**/inits/**/*.sh' --include='**/inits/*.sh' --include='**/inits/**/*.jsonc' --include='**/inits/*.jsonc' --include='**/templates/*.md' --include='**/templates/*.stone' --include='**/templates/*.guard' --exclude='*' src/ dist/",
38
+ "build:complete:dist": "rsync -a --prune-empty-dirs --include='*/' --exclude='**/.route/**' --exclude='**/.scratch/**' --exclude='**/.behavior/**' --exclude='**/*.test.sh' --include='**/readme.md' --include='**/*.template.md' --include='**/briefs/**/*.md' --include='**/briefs/*.md' --include='**/skills/**/*.sh' --include='**/skills/*.sh' --include='**/skills/**/*.jsonc' --include='**/skills/*.jsonc' --include='**/inits/**/*.sh' --include='**/inits/*.sh' --include='**/inits/**/*.jsonc' --include='**/inits/*.jsonc' --include='**/templates/*.md' --include='**/templates/*.stone' --include='**/templates/*.guard' --include='**/templates/*.guard.*' --exclude='*' src/ dist/",
39
39
  "build:complete:permissions": "find dist -name '*.sh' -type f -exec chmod +x {} \\;",
40
40
  "build:complete:repo": "npx rhachet repo introspect",
41
41
  "build:complete": "npm run build:complete:dist && npm run build:complete:permissions && npm run build:complete:repo",
@@ -89,11 +89,11 @@
89
89
  "esbuild-register": "3.6.0",
90
90
  "husky": "8.0.3",
91
91
  "jest": "30.2.0",
92
- "rhachet": "1.36.0",
92
+ "rhachet": "1.37.0",
93
93
  "rhachet-brains-anthropic": "0.3.3",
94
- "rhachet-roles-bhrain": "0.13.0",
94
+ "rhachet-roles-bhrain": "0.15.3",
95
95
  "rhachet-roles-bhuild": "link:.",
96
- "rhachet-roles-ehmpathy": "1.26.5",
96
+ "rhachet-roles-ehmpathy": "1.26.7",
97
97
  "tsc-alias": "1.8.10",
98
98
  "tsx": "4.20.6",
99
99
  "typescript": "5.4.5",
@@ -1,5 +0,0 @@
1
- # guard for vision stone
2
- # requires human approval before stone can be marked as passed
3
-
4
- judges:
5
- - npx rhachet run --repo bhrain --skill route.stone.judge --mechanism approved? --stone $stone --route $route
@@ -1,16 +0,0 @@
1
- # guard for criteria stone
2
- #
3
- # requires human approval before stone can be marked as passed
4
- # because the self-review prompts require human feedback,
5
- # the process needs to halt here for human review
6
-
7
- judges:
8
- - npx rhachet run --repo bhrain --skill route.stone.judge --mechanism approved? --stone $stone --route $route
9
-
10
- reviews:
11
- self:
12
- - slug: all-real-junior
13
- say: |
14
- a junior recently worked on this criteria. are there any unquestioned
15
- assumptions the junior took as requirements? any of these need to
16
- be asked to the wisher instead?
@@ -1,24 +0,0 @@
1
- # guard for blueprint stone
2
- # includes self-review prompts + human approval
3
-
4
- reviews:
5
- self:
6
- - slug: all-done-self
7
- say: |
8
- are you sure all of the criteria and vision was covered?
9
- emit a report into the .behavior dir on gaps detected. then, fix all gaps.
10
-
11
- - slug: all-done-junior
12
- say: |
13
- a junior recently worked on this blueprint. review against the criteria
14
- and vision and flag any gaps detected. emit a report into the
15
- .behavior dir if any and fix all gaps.
16
-
17
- - slug: all-simple-junior
18
- say: |
19
- a junior recently worked on this blueprint. are there any parts that
20
- are needlessly over complicated? any opportunities to simplify yet
21
- still fulfill the full vision and criteria?
22
-
23
- judges:
24
- - npx rhachet run --repo bhrain --skill route.stone.judge --mechanism approved? --stone $stone --route $route