@gtheys/pi-flow 0.0.0-stage → 0.2.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/README.md +833 -2
- package/adhoc/tracker.ts +360 -0
- package/aven/client.ts +996 -0
- package/aven/status.ts +395 -0
- package/brainstorm/args.ts +24 -0
- package/brainstorm/artifact.ts +67 -0
- package/brainstorm/paths.ts +43 -0
- package/brainstorm/prompt.ts +172 -0
- package/brainstorm/refs.ts +41 -0
- package/config.schema.json +161 -0
- package/config.ts +577 -0
- package/feedback/args.ts +21 -0
- package/feedback/prompt.ts +177 -0
- package/feedback/triage.ts +88 -0
- package/flow/agent-role.ts +46 -0
- package/flow/answer-wake.ts +212 -0
- package/flow/answer.ts +183 -0
- package/flow/args.ts +48 -0
- package/flow/ask-emitter.ts +331 -0
- package/flow/attribution.ts +145 -0
- package/flow/aven-resolve-exec.ts +95 -0
- package/flow/aven-resolve.ts +80 -0
- package/flow/awaiting-approval.ts +32 -0
- package/flow/binding-heal.ts +68 -0
- package/flow/cost-autopush.ts +162 -0
- package/flow/cost-command.ts +122 -0
- package/flow/cost-rows-journal.ts +296 -0
- package/flow/cost-rows-push.ts +112 -0
- package/flow/cost-rows-rows.ts +209 -0
- package/flow/cost-rows.ts +228 -0
- package/flow/cost.ts +173 -0
- package/flow/durable-refs.ts +287 -0
- package/flow/effect-gate.ts +137 -0
- package/flow/ensure-labels.ts +44 -0
- package/flow/frame.ts +172 -0
- package/flow/gates.ts +211 -0
- package/flow/jira-ref.ts +212 -0
- package/flow/label-gate.ts +149 -0
- package/flow/land-gate.ts +98 -0
- package/flow/lifecycle-policy.ts +162 -0
- package/flow/live-wait.ts +52 -0
- package/flow/liveness.ts +408 -0
- package/flow/loop-deps.ts +210 -0
- package/flow/loop-settle.ts +531 -0
- package/flow/loop.ts +437 -0
- package/flow/orchestrate.ts +45 -0
- package/flow/phase-command.ts +287 -0
- package/flow/phase-emoji.ts +13 -0
- package/flow/phase-prompts.ts +251 -0
- package/flow/picker.ts +307 -0
- package/flow/push.ts +475 -0
- package/flow/reconcile-command.ts +253 -0
- package/flow/reconcile-deps.ts +329 -0
- package/flow/reconcile.ts +738 -0
- package/flow/ref-kind.ts +80 -0
- package/flow/resume-picker.ts +222 -0
- package/flow/resume.ts +116 -0
- package/flow/run-health.ts +252 -0
- package/flow/run-liveness.ts +33 -0
- package/flow/state-metrics.ts +559 -0
- package/flow/status.ts +105 -0
- package/flow/step-output.ts +416 -0
- package/flow/steps.ts +73 -0
- package/flow/terminal-purge.ts +281 -0
- package/flow/turn-generation.ts +19 -0
- package/flow/v2-emission.ts +381 -0
- package/flow/v2-resume.ts +100 -0
- package/flow/vocabulary.ts +261 -0
- package/flow/widget.ts +448 -0
- package/flow/worktree-context.ts +136 -0
- package/flow-diagram/assemble.ts +27 -0
- package/flow-diagram/command.ts +252 -0
- package/flow-diagram/translate.ts +862 -0
- package/flow-diagram/vendor/harness-profiler/LICENSE +21 -0
- package/flow-diagram/vendor/harness-profiler/PIN.md +64 -0
- package/flow-diagram/vendor/harness-profiler/hp.js +960 -0
- package/flow-diagram/vendor/harness-profiler/load.ts +66 -0
- package/flow-diagram/vendor/harness-profiler/view.html +436 -0
- package/gates.ts +20 -0
- package/herdr/sync.ts +355 -0
- package/herdr/viewer.ts +432 -0
- package/implement/args.ts +21 -0
- package/implement/prompt.ts +98 -0
- package/implement/retry.ts +57 -0
- package/implement/routing.ts +31 -0
- package/index.ts +3206 -0
- package/mode-profile.ts +56 -0
- package/package.json +205 -4
- package/phase-state.ts +18 -0
- package/plan/args.ts +20 -0
- package/plan/prompt.ts +251 -0
- package/plan/size-check.ts +46 -0
- package/plan-tools/helpers.ts +177 -0
- package/plan-tools/jira-branch-tool.ts +54 -0
- package/plan-tools/jira-branch.ts +109 -0
- package/plan-tools/jira-issue.ts +85 -0
- package/plan-tools/resolve-feature-path.ts +30 -0
- package/plan-tools/resolve-notes-path.ts +37 -0
- package/plan-tools/resolve-spec-path.ts +31 -0
- package/pr-quality/index.ts +908 -0
- package/review/LICENSE +19 -0
- package/review/deviation.ts +252 -0
- package/review/review.ts +3053 -0
- package/review/sem-guidance.d.mts +8 -0
- package/review/sem-guidance.mjs +89 -0
- package/review/verdict.ts +13 -0
- package/run-state.ts +2046 -0
- package/run-title.ts +91 -0
- package/server/consumer.ts +146 -0
- package/server/daemon.ts +1094 -0
- package/server/lifecycle.ts +679 -0
- package/server/pending.ts +267 -0
- package/server/staleness.ts +320 -0
- package/server/writer.ts +86 -0
- package/shared/diff-base.ts +138 -0
- package/shared/flow-base.ts +210 -0
- package/shared/sonarqube-utils.ts +415 -0
- package/shared/stable-range.ts +102 -0
- package/slugify.ts +13 -0
- package/sonarqube/sonarqube.ts +821 -0
- package/spec-review/approve.ts +91 -0
- package/spec-review/args.ts +21 -0
- package/spec-review/aven-spec.ts +142 -0
- package/spec-review/commands.ts +336 -0
- package/spec-review/escape-regexp.ts +7 -0
- package/spec-review/open-in-pane.ts +166 -0
- package/spec-review/picker.ts +74 -0
- package/spec-review/prompt.ts +72 -0
- package/spec-review/publish-args.ts +33 -0
- package/spec-review/publish.ts +210 -0
- package/telemetry/attributes.ts +118 -0
- package/telemetry/content.ts +140 -0
- package/telemetry/dispatch.ts +521 -0
- package/telemetry/exporter.ts +124 -0
- package/telemetry/index.ts +776 -0
- package/telemetry/loki.ts +224 -0
- package/tools/code-review-parse.ts +518 -0
- package/tools/code-review.ts +312 -0
- package/tools/deviation.ts +737 -0
- package/tools/flow-submit.ts +302 -0
- package/tools/land.ts +608 -0
- package/tools/phase-complete.ts +476 -0
- package/tools/result.ts +18 -0
- package/tools/review-deps.ts +44 -0
- package/tools/run-attempt.ts +312 -0
- package/tools/spec-approve.ts +265 -0
- package/validate/args.ts +22 -0
- package/validate/deviation-gate.ts +229 -0
- package/validate/gate-target.ts +371 -0
- package/validate/gate.ts +79 -0
- package/validate/paths.ts +20 -0
- package/validate/personal.ts +104 -0
- package/validate/prompt.ts +525 -0
- package/validate/review-gate.ts +134 -0
- package/validate/subtask-range.ts +113 -0
- package/work-mode.ts +19 -0
- package/worktree/bootstrap.ts +243 -0
- package/worktree/branch.ts +168 -0
- package/worktree/herdr.ts +447 -0
- package/worktree/index.ts +1447 -0
- package/worktree/orphan.ts +384 -0
- package/worktree/remove-guards.ts +99 -0
- package/worktree/residue.ts +216 -0
- package/worktree/sweep.ts +526 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// AIDEV-NOTE: Loose type declarations for the review sem-guidance glue module.
|
|
2
|
+
export declare function getSemToolAvailability(activeToolNames?: string[]): {
|
|
3
|
+
[key: string]: boolean
|
|
4
|
+
}
|
|
5
|
+
export declare function buildSemReviewGuidance(
|
|
6
|
+
target: unknown,
|
|
7
|
+
toolsInput: unknown,
|
|
8
|
+
): string
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export function getSemToolAvailability(activeToolNames = []) {
|
|
2
|
+
const names = new Set(Array.isArray(activeToolNames) ? activeToolNames : [])
|
|
3
|
+
return {
|
|
4
|
+
diff: names.has('sem_diff'),
|
|
5
|
+
impact: names.has('sem_impact'),
|
|
6
|
+
context: names.has('sem_context'),
|
|
7
|
+
entities: names.has('sem_entities'),
|
|
8
|
+
any:
|
|
9
|
+
names.has('sem_diff') ||
|
|
10
|
+
names.has('sem_impact') ||
|
|
11
|
+
names.has('sem_context') ||
|
|
12
|
+
names.has('sem_entities'),
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function diffStep(target, tools) {
|
|
17
|
+
if (!tools.diff) return null
|
|
18
|
+
|
|
19
|
+
switch (target.type) {
|
|
20
|
+
case 'uncommitted':
|
|
21
|
+
return 'Start with `sem_diff` on the working tree to identify the changed functions, classes, blocks, and properties before reading large raw diffs.'
|
|
22
|
+
case 'commit':
|
|
23
|
+
return `Start with \`sem_diff\` for commit \`${target.sha}\` to inventory changed entities and spot the riskiest touched code paths.`
|
|
24
|
+
case 'baseBranch':
|
|
25
|
+
if (target.mergeBase) {
|
|
26
|
+
return `Start with \`sem_diff\` over the range \`${target.mergeBase}..HEAD\` to see the semantic shape of the branch before diving into line hunks.`
|
|
27
|
+
}
|
|
28
|
+
return `Use \`sem_diff\` once you know the merge-base range for branch \`${target.branch}\`; use it for overview, not as the only source of review evidence.`
|
|
29
|
+
case 'pullRequest':
|
|
30
|
+
if (target.mergeBase) {
|
|
31
|
+
return `Start with \`sem_diff\` over \`${target.mergeBase}..HEAD\` to understand the PR's changed entities before line-level verification.`
|
|
32
|
+
}
|
|
33
|
+
return `Use \`sem_diff\` for the PR diff once the merge base is known; use it as a semantic overview, not the sole review source.`
|
|
34
|
+
case 'folder':
|
|
35
|
+
return null
|
|
36
|
+
case 'custom':
|
|
37
|
+
return 'Use `sem_diff` only if the custom instructions are about change analysis or review summaries; do not default to it for snapshot/file-reading tasks.'
|
|
38
|
+
default:
|
|
39
|
+
return null
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function contextStep(target, tools) {
|
|
44
|
+
if (!tools.context) return null
|
|
45
|
+
if (target.type === 'folder') {
|
|
46
|
+
return 'Prefer `sem_context` when one function/class inside the reviewed files looks suspicious and you need compact, dependency-aware context instead of reading whole large files.'
|
|
47
|
+
}
|
|
48
|
+
return 'Prefer `sem_context` for the specific changed entity you are reasoning about. Use it before loading whole large files when you need focused context around a function, method, class, or block.'
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function impactStep(tools) {
|
|
52
|
+
if (!tools.impact) return null
|
|
53
|
+
return 'Use `sem_impact` on 1-3 risky changed entities when you suspect hidden blast radius, affected tests, or cross-module consequences. Prefer `scope=tests` for test selection and `scope=all` when validating broader impact.'
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function entitiesStep(target, tools) {
|
|
57
|
+
if (!tools.entities) return null
|
|
58
|
+
if (target.type === 'folder') {
|
|
59
|
+
return 'Use `sem_entities` to inventory the reviewed files and pick the highest-value functions/classes/blocks before deeper inspection.'
|
|
60
|
+
}
|
|
61
|
+
return 'Use `sem_entities` if you need a quick structural inventory of a changed file before drilling into a suspicious entity.'
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function buildSemReviewGuidance(target, toolsInput) {
|
|
65
|
+
const tools =
|
|
66
|
+
toolsInput && typeof toolsInput === 'object' && toolsInput.any !== undefined
|
|
67
|
+
? toolsInput
|
|
68
|
+
: getSemToolAvailability([])
|
|
69
|
+
|
|
70
|
+
if (!tools.any) return null
|
|
71
|
+
|
|
72
|
+
const steps = [
|
|
73
|
+
diffStep(target, tools),
|
|
74
|
+
impactStep(tools),
|
|
75
|
+
contextStep(target, tools),
|
|
76
|
+
entitiesStep(target, tools),
|
|
77
|
+
'Always confirm final findings with raw `git diff`, `read`, or direct file inspection before citing line numbers or writing the review comment.',
|
|
78
|
+
'sem may under-cover tests, assets, generated files, or non-semantic glue code. If semantic coverage looks incomplete, fall back to raw git/file inspection.',
|
|
79
|
+
].filter(Boolean)
|
|
80
|
+
|
|
81
|
+
if (steps.length === 0) return null
|
|
82
|
+
|
|
83
|
+
const header =
|
|
84
|
+
target.type === 'folder'
|
|
85
|
+
? '## Semantic tooling for this snapshot review'
|
|
86
|
+
: '## Semantic tooling for this diff review'
|
|
87
|
+
|
|
88
|
+
return `${header}\n\n${steps.map((step, index) => `${index + 1}. ${step}`).join('\n')}`
|
|
89
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// AIDEV-NOTE: Machine-readable verdict contract appended to every /review
|
|
2
|
+
// review artifact (PMR-5PCB). Since PMR-W8SG both sides live in pi-flow:
|
|
3
|
+
// validate/review-gate.ts owns the contract wording (VERDICT_HEADING,
|
|
4
|
+
// BLOCKER_LINE, REVIEW_CONTRACT_PROMPT) and parses the artifact; this module
|
|
5
|
+
// only composes the emitter instructions from those shared constants. Never
|
|
6
|
+
// reword the contract here — change review-gate.ts.
|
|
7
|
+
import { BLOCKER_LINE, VERDICT_HEADING } from '../validate/review-gate.ts'
|
|
8
|
+
|
|
9
|
+
export const REVIEW_VERDICT_INSTRUCTIONS = `7. End the review with a machine-readable verdict section:
|
|
10
|
+
${VERDICT_HEADING}
|
|
11
|
+
blockers_count: <N>
|
|
12
|
+
${BLOCKER_LINE}
|
|
13
|
+
where N is the number of must-fix (P0/P1) findings, 0 when clean.`
|