@papi-ai/server 0.7.12 → 0.7.14
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/index.js +729 -67
- package/dist/prompts.js +31 -0
- package/package.json +1 -2
package/dist/prompts.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
// src/prompts.ts
|
|
2
|
+
var AD_REJECTION_RULES = `**AD Minting Guard \u2014 REJECT observations dressed as decisions.**
|
|
3
|
+
|
|
4
|
+
An Active Decision expresses a *stance* the project is taking \u2014 a choice between alternatives that constrains future work. Reject any candidate AD whose body asserts:
|
|
5
|
+
(a) the existence, identity, or status of a person, user, or external entity (e.g. "User X is building Y", "Customer Z is active");
|
|
6
|
+
(b) a metric or measurement (e.g. "Signups grew 3x last cycle", "Latency dropped to 200ms");
|
|
7
|
+
(c) a fact about the current state of the world that could be confirmed or denied by a query rather than challenged by argument (e.g. "External user feedback is now flowing", "The /admin route exists").
|
|
8
|
+
|
|
9
|
+
If a candidate AD body could be invalidated by running a SQL query, refreshing a dashboard, or checking a log \u2014 it is an observation, not a decision. Capture it as a build report finding, a dogfood observation, a cycle log note, or a registered doc instead. Do NOT mint it as an AD.
|
|
10
|
+
|
|
11
|
+
**Positive example (valid AD):** "Pricing tier strategy: free engine + paid intelligence. Decision: keep cycles free, charge for strategy reviews and analytics. Why: telemetry shows engagement clusters around intelligence surfaces, not engine surfaces." \u2014 this is a stance with alternatives.
|
|
12
|
+
|
|
13
|
+
**Negative example (reject):** "External user feedback is now flowing. Stonebridge Systems is actively building." \u2014 this is a fact about the current state of the world. Capture as dogfood/signal observation; do not mint.
|
|
14
|
+
|
|
15
|
+
This rule applies to: new ADs proposed during planning (Step 9), strategy review AD updates (section 5), and strategy_change AD updates. If you find an existing AD that violates this rule during housekeeping, propose deleting it (action: "delete") with a one-line rationale.`;
|
|
2
16
|
var PLAN_SYSTEM = `You are the PAPI Cycle Planner \u2014 an autonomous planning engine for software projects.
|
|
3
17
|
You receive project context and produce a planning cycle output with a BUILD HANDOFF.
|
|
4
18
|
|
|
@@ -224,6 +238,9 @@ Standard planning cycle with full board review.
|
|
|
224
238
|
|
|
225
239
|
9. **Active Decisions** \u2014 If any AD needs updating: Type A (confidence change), Type B (modification), or Type C (reversal/supersede).
|
|
226
240
|
**AD Quality Bar:** ADs are for product and architecture choices that constrain future work \u2014 technology selections, data model designs, UX principles, strategic positioning. They are NOT for: process preferences (commit style, PR size), configuration choices (linter rules, tab width), or temporary workarounds. If a decision doesn't affect what gets built or how it's architected, it's not an AD. Apply this bar when proposing new ADs and when triaging existing ones.
|
|
241
|
+
|
|
242
|
+
${AD_REJECTION_RULES}
|
|
243
|
+
|
|
227
244
|
**\u2192 PERSIST:** EVERY AD you created, updated, or confirmed with changes MUST appear in \`activeDecisions\` array in Part 2. Include the full replacement body with ### heading.
|
|
228
245
|
|
|
229
246
|
### Operational Quality Rules
|
|
@@ -461,6 +478,9 @@ Standard planning cycle with full board review.
|
|
|
461
478
|
|
|
462
479
|
9. **Active Decisions** \u2014 If any AD needs updating: Type A (confidence change), Type B (modification), or Type C (reversal/supersede).
|
|
463
480
|
**AD Quality Bar:** ADs are for product and architecture choices that constrain future work \u2014 technology selections, data model designs, UX principles, strategic positioning. They are NOT for: process preferences (commit style, PR size), configuration choices (linter rules, tab width), or temporary workarounds. If a decision doesn't affect what gets built or how it's architected, it's not an AD. Apply this bar when proposing new ADs and when triaging existing ones.
|
|
481
|
+
|
|
482
|
+
${AD_REJECTION_RULES}
|
|
483
|
+
|
|
464
484
|
**\u2192 PERSIST:** EVERY AD you created, updated, or confirmed with changes MUST appear in \`activeDecisions\` array in Part 2. Include the full replacement body with ### heading.
|
|
465
485
|
|
|
466
486
|
### Operational Quality Rules
|
|
@@ -535,6 +555,9 @@ function buildPlanUserMessage(ctx) {
|
|
|
535
555
|
}) : PLAN_FULL_INSTRUCTIONS;
|
|
536
556
|
parts.push(instructions);
|
|
537
557
|
}
|
|
558
|
+
if (ctx.foundationalTasksGuidance) {
|
|
559
|
+
parts.push("", ctx.foundationalTasksGuidance);
|
|
560
|
+
}
|
|
538
561
|
if (ctx.skipHandoffs) {
|
|
539
562
|
parts.push(
|
|
540
563
|
"",
|
|
@@ -830,6 +853,8 @@ You MUST cover these 5 sections. Each is mandatory.
|
|
|
830
853
|
- Note any hierarchy/phase issues worth correcting (1-2 bullets max)
|
|
831
854
|
- Delete ADs that are legacy, process-level, or redundant without discussion
|
|
832
855
|
|
|
856
|
+
${AD_REJECTION_RULES}
|
|
857
|
+
|
|
833
858
|
**Registered Documents:** If a "### Registered Documents" section is present in context, scan it for: (a) research findings that contradict current ADs or strategy, (b) unactioned research that should influence the next plan. Reference relevant docs by title in your review. If unregistered docs are listed, flag 1-2 that look strategically relevant and suggest registering them.
|
|
834
859
|
|
|
835
860
|
## CONDITIONAL SECTIONS (include only when genuinely useful \u2014 most reviews should have 0-2 of these)
|
|
@@ -1056,6 +1081,9 @@ function buildReviewUserMessage(ctx) {
|
|
|
1056
1081
|
if (ctx.docActionStaleness) {
|
|
1057
1082
|
parts.push("### Doc Action Staleness", "", ctx.docActionStaleness, "");
|
|
1058
1083
|
}
|
|
1084
|
+
if (ctx.pendingAgendaTopics) {
|
|
1085
|
+
parts.push("### Queued Agenda Topics", "", "_Topics queued via `strategy_agenda` since the last review. Address each one in this review \u2014 they will be auto-marked as addressed on apply._", "", ctx.pendingAgendaTopics, "");
|
|
1086
|
+
}
|
|
1059
1087
|
return parts.join("\n");
|
|
1060
1088
|
}
|
|
1061
1089
|
function parseReviewStructuredOutput(raw) {
|
|
@@ -1136,6 +1164,8 @@ The JSON must be valid. Only include ADs that need changes \u2014 omit unchanged
|
|
|
1136
1164
|
For new ADs, use the next available AD number.
|
|
1137
1165
|
The body field must be the COMPLETE replacement text for the AD block (including the ### heading line).
|
|
1138
1166
|
|
|
1167
|
+
${AD_REJECTION_RULES}
|
|
1168
|
+
|
|
1139
1169
|
## PHASE UPDATES
|
|
1140
1170
|
|
|
1141
1171
|
If the strategic change affects the project's phase structure, include a phaseUpdates array.
|
|
@@ -1432,6 +1462,7 @@ ${inputs.codebaseContext}
|
|
|
1432
1462
|
Return a JSON array of 3-10 tasks based on gaps, improvements, and next steps visible from the codebase analysis above.`;
|
|
1433
1463
|
}
|
|
1434
1464
|
export {
|
|
1465
|
+
AD_REJECTION_RULES,
|
|
1435
1466
|
AD_SEED_SYSTEM,
|
|
1436
1467
|
CONVENTIONS_SYSTEM,
|
|
1437
1468
|
HANDOFF_REGEN_SYSTEM,
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@papi-ai/server",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"mcpName": "io.github.cathalos92/papi",
|
|
3
|
+
"version": "0.7.14",
|
|
5
4
|
"description": "PAPI MCP server — AI-powered sprint planning, build execution, and strategy review for software projects",
|
|
6
5
|
"license": "Elastic-2.0",
|
|
7
6
|
"type": "module",
|