@niwa-labs/pstack 0.0.0-stage → 0.0.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.
Files changed (163) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +260 -2
  3. package/package.json +28 -4
  4. package/scripts/upstream-map.ts +90 -0
  5. package/src/author.ts +57 -0
  6. package/src/binding.ts +32 -0
  7. package/src/catalog.ts +86 -0
  8. package/src/composition.ts +66 -0
  9. package/src/index.ts +50 -0
  10. package/src/mapping/analyze.ts +223 -0
  11. package/src/mapping/assemble.ts +96 -0
  12. package/src/mapping/diff.ts +139 -0
  13. package/src/mapping/format.ts +67 -0
  14. package/src/mapping/git.ts +69 -0
  15. package/src/mapping/index.ts +18 -0
  16. package/src/mapping/maintain.ts +36 -0
  17. package/src/mapping/schema.ts +50 -0
  18. package/src/mapping/sources.ts +108 -0
  19. package/src/mapping/tool.ts +77 -0
  20. package/src/mapping/verify.ts +130 -0
  21. package/src/plugin.ts +136 -0
  22. package/src/policy.ts +115 -0
  23. package/src/ports.ts +184 -0
  24. package/src/pr-binding.ts +88 -0
  25. package/src/records.ts +61 -0
  26. package/src/roles.ts +49 -0
  27. package/src/trunk.ts +59 -0
  28. package/src/upstream-actions.ts +135 -0
  29. package/src/upstream-records.ts +71 -0
  30. package/src/upstream.ts +151 -0
  31. package/src/workflows/adapted.md +780 -0
  32. package/src/workflows/authoring-a-skill.ts +52 -0
  33. package/src/workflows/autonomous-run.ts +56 -0
  34. package/src/workflows/autopilot-full.ts +90 -0
  35. package/src/workflows/autopilot-stack.ts +125 -0
  36. package/src/workflows/babysit.ts +124 -0
  37. package/src/workflows/benny-reproduce.ts +122 -0
  38. package/src/workflows/benny-triage.ts +89 -0
  39. package/src/workflows/bug-fix.ts +54 -0
  40. package/src/workflows/entry.ts +130 -0
  41. package/src/workflows/eval.ts +63 -0
  42. package/src/workflows/feature.ts +54 -0
  43. package/src/workflows/hillclimb.ts +78 -0
  44. package/src/workflows/investigation.ts +41 -0
  45. package/src/workflows/lib/catalog.ts +45 -0
  46. package/src/workflows/lib/change.ts +70 -0
  47. package/src/workflows/lib/forensics.ts +37 -0
  48. package/src/workflows/lib/git.ts +30 -0
  49. package/src/workflows/lib/go.ts +58 -0
  50. package/src/workflows/lib/inputs.ts +34 -0
  51. package/src/workflows/lib/lane.ts +170 -0
  52. package/src/workflows/lib/measure.ts +34 -0
  53. package/src/workflows/lib/plan.ts +24 -0
  54. package/src/workflows/lib/script.ts +79 -0
  55. package/src/workflows/lib/ship.ts +110 -0
  56. package/src/workflows/lib/texts.ts +18 -0
  57. package/src/workflows/lib/trunk.ts +91 -0
  58. package/src/workflows/multi-phase-plan.ts +83 -0
  59. package/src/workflows/opening-a-pr.ts +62 -0
  60. package/src/workflows/pause-safely.ts +50 -0
  61. package/src/workflows/perf-issue.ts +87 -0
  62. package/src/workflows/prototype.ts +76 -0
  63. package/src/workflows/refactoring.ts +54 -0
  64. package/src/workflows/runtime-forensics.ts +26 -0
  65. package/src/workflows/scenarios.ts +380 -0
  66. package/src/workflows/session-pickup.ts +57 -0
  67. package/src/workflows/shipping.ts +63 -0
  68. package/src/workflows/suite.ts +129 -0
  69. package/src/workflows/texts/authoring-a-skill.json +5 -0
  70. package/src/workflows/texts/autonomous-run.json +5 -0
  71. package/src/workflows/texts/autopilot-full.json +5 -0
  72. package/src/workflows/texts/autopilot-stack.json +5 -0
  73. package/src/workflows/texts/babysit.json +5 -0
  74. package/src/workflows/texts/benny-reproduce.json +5 -0
  75. package/src/workflows/texts/benny-triage.json +5 -0
  76. package/src/workflows/texts/bug-fix.json +5 -0
  77. package/src/workflows/texts/bugbot-triage.json +5 -0
  78. package/src/workflows/texts/eval.json +5 -0
  79. package/src/workflows/texts/feature.json +5 -0
  80. package/src/workflows/texts/hillclimb.json +5 -0
  81. package/src/workflows/texts/investigation.json +5 -0
  82. package/src/workflows/texts/multi-phase-plan.json +5 -0
  83. package/src/workflows/texts/opening-a-pr.json +5 -0
  84. package/src/workflows/texts/pause-safely.json +5 -0
  85. package/src/workflows/texts/perf-issue.json +5 -0
  86. package/src/workflows/texts/prototype.json +5 -0
  87. package/src/workflows/texts/refactoring.json +5 -0
  88. package/src/workflows/texts/runtime-forensics.json +5 -0
  89. package/src/workflows/texts/session-pickup.json +5 -0
  90. package/src/workflows/texts/trace-forensics.json +5 -0
  91. package/src/workflows/texts/visual-parity.json +5 -0
  92. package/src/workflows/texts/worker.json +5 -0
  93. package/src/workflows/trace-forensics.ts +27 -0
  94. package/src/workflows/upstream-sync.ts +182 -0
  95. package/src/workflows/visual-parity.ts +52 -0
  96. package/src/workflows/worktree-cleanup.ts +57 -0
  97. package/test/author.test.ts +61 -0
  98. package/test/benny.test.ts +138 -0
  99. package/test/binding.test.ts +54 -0
  100. package/test/catalog-helpers.test.ts +49 -0
  101. package/test/closure.test.ts +45 -0
  102. package/test/composition.test.ts +23 -0
  103. package/test/eval.test.ts +23 -0
  104. package/test/lanes.test.ts +334 -0
  105. package/test/mapping-diff.test.ts +64 -0
  106. package/test/mapping-support.ts +110 -0
  107. package/test/mapping-texts.test.ts +106 -0
  108. package/test/mapping.test.ts +276 -0
  109. package/test/package-layout.ts +68 -0
  110. package/test/policy.test.ts +98 -0
  111. package/test/ports.test.ts +45 -0
  112. package/test/ports.ts +173 -0
  113. package/test/roles.test.ts +21 -0
  114. package/test/suite.test.ts +167 -0
  115. package/test/support.ts +541 -0
  116. package/test/texts.test.ts +174 -0
  117. package/test/tool.test.ts +48 -0
  118. package/test/trunk-helpers.test.ts +149 -0
  119. package/test/trunk.test.ts +24 -0
  120. package/test/upstream-sync.test.ts +246 -0
  121. package/test/upstream.test.ts +106 -0
  122. package/test/worktree-cleanup.test.ts +107 -0
  123. package/tsconfig.json +7 -0
  124. package/upstream/LICENSE +21 -0
  125. package/upstream/SOURCE.json +5 -0
  126. package/upstream/benny/FOR_AGENTS.md +89 -0
  127. package/upstream/benny/README.md +23 -0
  128. package/upstream/benny/skills/reproduce-and-fix-issues/SKILL.md +310 -0
  129. package/upstream/benny/skills/reproduce-and-fix-issues/references/control-adapter.md +169 -0
  130. package/upstream/benny/skills/reproduce-and-fix-issues/references/feature-map.example.md +205 -0
  131. package/upstream/benny/skills/reproduce-and-fix-issues/references/verify-existing-fix.md +93 -0
  132. package/upstream/benny/skills/setup-benny/SKILL.md +265 -0
  133. package/upstream/benny/skills/triage-issue-reports/SKILL.md +240 -0
  134. package/upstream/benny/skills/triage-issue-reports/references/routing.example.md +61 -0
  135. package/upstream/benny/templates/configuration.example.yaml +84 -0
  136. package/upstream/benny/templates/reproduce-automation-prompt.md +33 -0
  137. package/upstream/benny/templates/triage-automation-prompt.md +39 -0
  138. package/upstream/mapping.json +699 -0
  139. package/upstream/poteto-mode/SKILL.md +110 -0
  140. package/upstream/poteto-mode/playbooks/authoring-a-skill.md +12 -0
  141. package/upstream/poteto-mode/playbooks/autonomous-run.md +13 -0
  142. package/upstream/poteto-mode/playbooks/autopilot-full.md +25 -0
  143. package/upstream/poteto-mode/playbooks/autopilot-stack.md +8 -0
  144. package/upstream/poteto-mode/playbooks/babysit.md +10 -0
  145. package/upstream/poteto-mode/playbooks/bug-fix.md +15 -0
  146. package/upstream/poteto-mode/playbooks/eval.md +25 -0
  147. package/upstream/poteto-mode/playbooks/feature.md +21 -0
  148. package/upstream/poteto-mode/playbooks/hillclimb.md +21 -0
  149. package/upstream/poteto-mode/playbooks/investigation.md +14 -0
  150. package/upstream/poteto-mode/playbooks/multi-phase-plan.md +11 -0
  151. package/upstream/poteto-mode/playbooks/opening-a-pr.md +9 -0
  152. package/upstream/poteto-mode/playbooks/pause-safely.md +10 -0
  153. package/upstream/poteto-mode/playbooks/perf-issue.md +25 -0
  154. package/upstream/poteto-mode/playbooks/prototype.md +14 -0
  155. package/upstream/poteto-mode/playbooks/refactoring.md +16 -0
  156. package/upstream/poteto-mode/playbooks/runtime-forensics.md +11 -0
  157. package/upstream/poteto-mode/playbooks/session-pickup.md +11 -0
  158. package/upstream/poteto-mode/playbooks/shipping.md +12 -0
  159. package/upstream/poteto-mode/playbooks/trace-forensics.md +14 -0
  160. package/upstream/poteto-mode/playbooks/visual-parity.md +11 -0
  161. package/upstream/poteto-mode/playbooks/worktree-cleanup.md +12 -0
  162. package/upstream/poteto-mode/references/bugbot-triage.md +142 -0
  163. package/upstream/poteto-mode/worker.md +11 -0
@@ -0,0 +1,84 @@
1
+ schema_version: 1
2
+
3
+ automations:
4
+ triage_name: "benny-triage"
5
+ reproduce_name: "benny-reproduce"
6
+
7
+ slack:
8
+ source_channel_id: "SOURCE_CHANNEL_ID"
9
+ operations_channel_id: ""
10
+ triage_identity_user_id: "TRIAGE_IDENTITY_USER_ID"
11
+ read_action: "configured-slack-read-action"
12
+ thread_post_action: "configured-slack-thread-post-action"
13
+ file_download_action: "configured-slack-file-download-action"
14
+ operations_edit_action: "configured-slack-edit-action"
15
+ prefer_cursor_actions: true
16
+ optional_bot_token_env: "BENNY_SLACK_BOT_TOKEN"
17
+ allow_source_root_posts: false
18
+ allow_worker_slack_writes: false
19
+
20
+ repository:
21
+ url: "https://github.com/example-org/example-repo"
22
+ default_branch: "main"
23
+ pull_request_action: "configured-draft-pull-request-action"
24
+ pull_request_url_format: "https://github.com/{owner}/{repo}/pull/{number}"
25
+ draft_only: true
26
+
27
+ tracker:
28
+ type: "linear"
29
+ adapter_skill_name: "issue-tracker-adapter-placeholder"
30
+ team: "team-placeholder"
31
+ project: "project-placeholder"
32
+ labels:
33
+ bug: "bug-label-placeholder"
34
+ performance: "performance-label-placeholder"
35
+ intake: "intake-label-placeholder"
36
+ needs_repro: "needs-repro-label-placeholder"
37
+ status: "intake-status-placeholder"
38
+ source_link_title: "Slack report"
39
+ require_compensation_action: true
40
+
41
+ routing:
42
+ map_path: ".cursor/benny/routing.md"
43
+ owner_pings_default: false
44
+ allow_feature_owner_ping: false
45
+ allow_confirmed_regression_author_ping: false
46
+
47
+ control:
48
+ skill_name: "control-target-app"
49
+ feature_map_path: ".cursor/benny/feature-map.md"
50
+ environment: "safe-test-environment-placeholder"
51
+ artifact_directory: "/tmp/benny-artifacts"
52
+ artifact_retention_hours: 24
53
+
54
+ verdict_markers:
55
+ bug: "[benny:bug]"
56
+ performance: "[benny:performance]"
57
+ other: "[benny:other]"
58
+ tracker_attribute: "tracker"
59
+
60
+ status_emoji:
61
+ seen: "👀"
62
+ reproducing: "🔎"
63
+ reproduced: "✅"
64
+ could_not_reproduce: "⚪"
65
+ blocked: "⛔"
66
+ fixing: "🛠️"
67
+ fix_failed: "❌"
68
+ pull_request_opened: "🔗"
69
+
70
+ budgets:
71
+ poll_seconds: 45
72
+ verdict_wait_minutes: 45
73
+ triage_follow_up_minutes: 10
74
+ triage_total_minutes: 30
75
+ repro_minutes: 60
76
+ rejection_window_minutes: 10
77
+ fix_minutes: 90
78
+ operations_follow_up_minutes: 45
79
+
80
+ models:
81
+ triage: "choose-an-available-public-model-slug"
82
+ reproduce: "choose-an-available-public-model-slug"
83
+ code: "choose-an-available-public-model-slug"
84
+ media_review: "choose-an-available-public-model-slug"
@@ -0,0 +1,33 @@
1
+ # Reproduce automation prompt
2
+
3
+ > Source material for the copied setup workflow. Paraphrase this intent into a built-in `automate` draft after `automate` confirms that the copied pack is committed in the repository where the automation will run.
4
+
5
+ Read and follow `.cursor/automations/benny/skills/reproduce-and-fix-issues/SKILL.md` for this run.
6
+
7
+ Configuration source. Include this repository-relative path only when it is committed in the same target repository. Otherwise paraphrase the configured values. Never use a plugin source or cache path:
8
+
9
+ ```text
10
+ {{BENNY_CONFIG_PATH}}
11
+ ```
12
+
13
+ Trigger:
14
+
15
+ ```json
16
+ {
17
+ "source_channel_id": "{{SLACK_CHANNEL_ID}}",
18
+ "message_ts": "{{SLACK_MESSAGE_TS}}",
19
+ "thread_ts": "{{SLACK_THREAD_TS_OR_EMPTY}}"
20
+ }
21
+ ```
22
+
23
+ The creation intent should describe this as a new top-level report in the configured source Slack channel. It should include the configured repository, default branch, issue tracker, control adapter, feature map, and draft pull request capability.
24
+
25
+ Treat the source channel and root thread timestamp as immutable. If either is missing or does not match configuration, stop without posting.
26
+
27
+ Wait for a configured triage marker from the configured triage identity in this exact thread. Proceed only for `[benny:bug]` or `[benny:performance]`.
28
+
29
+ Require the configured control-adapter skill before attempting a repro. Reproduce the exact discriminating symptom twice through the real UI. Verify existing pull requests or commits without authoring over them. Attempt a bounded fix only after a confirmed repro and the operational file's fix gate.
30
+
31
+ The coordinator is the only Slack poster. Every child prompt must forbid `SendSlackMessage`, `PostToSlack`, `chat.postMessage`, and all other Slack writes. Children return findings only.
32
+
33
+ Never post a root message in the source channel.
@@ -0,0 +1,39 @@
1
+ # Triage automation prompt
2
+
3
+ > Source material for the copied setup workflow. Paraphrase this intent into a built-in `automate` draft after `automate` confirms that the copied pack is committed in the repository where the automation will run.
4
+
5
+ Read and follow `.cursor/automations/benny/skills/triage-issue-reports/SKILL.md` for this run.
6
+
7
+ Configuration source. Include this repository-relative path only when it is committed in the same target repository. Otherwise paraphrase the configured values. Never use a plugin source or cache path:
8
+
9
+ ```text
10
+ {{BENNY_CONFIG_PATH}}
11
+ ```
12
+
13
+ Trigger:
14
+
15
+ ```json
16
+ {
17
+ "source_channel_id": "{{SLACK_CHANNEL_ID}}",
18
+ "message_ts": "{{SLACK_MESSAGE_TS}}",
19
+ "thread_ts": "{{SLACK_THREAD_TS_OR_EMPTY}}"
20
+ }
21
+ ```
22
+
23
+ The creation intent should describe this as a new top-level report in the configured source Slack channel.
24
+
25
+ Treat the source channel and root thread timestamp as immutable. If either is missing or does not match configuration, stop without posting or writing to the issue tracker.
26
+
27
+ The committed operational file owns classification, attachment review, cause tracing, routing, dedupe, tracker writes, and the final verdict. Post no progress messages. Never post a root message in the source channel.
28
+
29
+ The coordinator is the only Slack poster. Any delegated worker must be read-only, return findings only, and receive an explicit ban on every Slack write action.
30
+
31
+ End the single verdict with exactly one configured marker:
32
+
33
+ ```text
34
+ [benny:bug]
35
+ [benny:performance]
36
+ [benny:other]
37
+ ```
38
+
39
+ A bug or performance marker may add `tracker=<URL>`.