@wrongstack/sdd 0.307.0 → 0.307.1
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.d.ts +2 -1
- package/dist/index.js +93 -2
- package/dist/vibe-protocol-wiring.d.ts +10 -0
- package/dist/vibe-protocol.d.ts +5 -0
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -29,5 +29,6 @@ export { makeLlmSubtaskGenerator, makePlanningDecomposer, type PlanningDecompose
|
|
|
29
29
|
export { splitGraphNode, type SplitGraphNodeOptions } from './graph-split.js';
|
|
30
30
|
export { assessTaskNodeAtomicity, decomposeNonAtomicTasks, type DecompositionProposal, type PlanDecomposeOptions, type PlanDecomposeResult, } from './plan-decompose.js';
|
|
31
31
|
export { makePreferSideConflictResolver, makeLlmConflictResolver, resolveConflictText, hasConflictMarkers, type ConflictSide, type LlmConflictResolverOptions, } from './conflict-resolver.js';
|
|
32
|
-
export { synthesizeVibeSpec, buildCoderContract, auditVibeExecution, formatVibeReport, type VibeScopeBoundaries, type VibeSpecSynthesizerResult, type VibeCoderContract, type VibeAuditCheck, type VibeAuditVerdict, type VibeVerificationReport, } from './vibe-protocol.js';
|
|
32
|
+
export { synthesizeVibeSpec, buildCoderContract, auditVibeExecution, formatVibeReport, isIdentifierLikeExclusion, type VibeScopeBoundaries, type VibeSpecSynthesizerResult, type VibeCoderContract, type VibeAuditCheck, type VibeAuditVerdict, type VibeVerificationReport, } from './vibe-protocol.js';
|
|
33
|
+
export { installVibeProtocol, VIBE_PROTOCOL_META_KEY } from './vibe-protocol-wiring.js';
|
|
33
34
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -5783,6 +5783,12 @@ function makeLlmConflictResolver(opts) {
|
|
|
5783
5783
|
|
|
5784
5784
|
// src/vibe-protocol.ts
|
|
5785
5785
|
import { stripVibeTag } from "@wrongstack/requirement-intake";
|
|
5786
|
+
function isIdentifierLikeExclusion(excluded) {
|
|
5787
|
+
const trimmed = excluded.trim();
|
|
5788
|
+
if (trimmed.length < 2) return false;
|
|
5789
|
+
if (/^['"`].+['"`]$/.test(trimmed)) return true;
|
|
5790
|
+
return !/\s/.test(trimmed);
|
|
5791
|
+
}
|
|
5786
5792
|
function synthesizeVibeSpec(rawPrompt, projectContext = "") {
|
|
5787
5793
|
const cleanPrompt = stripVibeTag(rawPrompt);
|
|
5788
5794
|
const lines = cleanPrompt.split(/[\n;]+/).map((line) => line.trim()).filter(Boolean);
|
|
@@ -5865,6 +5871,7 @@ function auditVibeExecution(input) {
|
|
|
5865
5871
|
}
|
|
5866
5872
|
let scopeClean = true;
|
|
5867
5873
|
for (const excluded of spec.scopeBoundaries.excluded) {
|
|
5874
|
+
if (!isIdentifierLikeExclusion(excluded)) continue;
|
|
5868
5875
|
if (coderOutput.toLowerCase().includes(excluded.toLowerCase())) {
|
|
5869
5876
|
scopeClean = false;
|
|
5870
5877
|
checks.push({
|
|
@@ -5888,7 +5895,7 @@ function auditVibeExecution(input) {
|
|
|
5888
5895
|
id: "acceptance-criteria",
|
|
5889
5896
|
name: "Acceptance Criteria Alignment",
|
|
5890
5897
|
passed: hasCoderOutput,
|
|
5891
|
-
details: `
|
|
5898
|
+
details: hasCoderOutput ? `Coder produced output against a contract of ${spec.acceptanceCriteria.length} acceptance criteria (not independently executed)` : "No coder output to align with acceptance criteria"
|
|
5892
5899
|
});
|
|
5893
5900
|
const allPassed = checks.every((c) => c.passed);
|
|
5894
5901
|
const score = Math.round(checks.filter((c) => c.passed).length / checks.length * 100);
|
|
@@ -5908,7 +5915,8 @@ function formatVibeReport(rawPrompt, spec, coder, audit) {
|
|
|
5908
5915
|
"- **\u{1F9E9} Sensible Defaults:**",
|
|
5909
5916
|
...spec.sensibleDefaults.map((d) => ` \u2022 ${d}`),
|
|
5910
5917
|
"- **\u{1F4CB} Acceptance Criteria:**",
|
|
5911
|
-
...spec.acceptanceCriteria.map((ac) => ` - [
|
|
5918
|
+
...spec.acceptanceCriteria.map((ac) => ` - [ ] ${ac}`),
|
|
5919
|
+
"- _Auditor did not independently execute these criteria._",
|
|
5912
5920
|
"",
|
|
5913
5921
|
"---",
|
|
5914
5922
|
"",
|
|
@@ -5925,6 +5933,86 @@ function formatVibeReport(rawPrompt, spec, coder, audit) {
|
|
|
5925
5933
|
...audit.reworkDirectives && audit.reworkDirectives.length > 0 ? ["", "**\u{1F527} Rework Instructions:**", ...audit.reworkDirectives.map((r) => ` - ${r}`)] : []
|
|
5926
5934
|
].join("\n");
|
|
5927
5935
|
}
|
|
5936
|
+
|
|
5937
|
+
// src/vibe-protocol-wiring.ts
|
|
5938
|
+
import { hasVibeTag } from "@wrongstack/requirement-intake";
|
|
5939
|
+
var VIBE_PROTOCOL_META_KEY = "vibeProtocol";
|
|
5940
|
+
function formatCoderInput(spec, coder) {
|
|
5941
|
+
return [
|
|
5942
|
+
"[vibe_protocol]",
|
|
5943
|
+
"The user explicitly requested the VIBE three-stage verification protocol.",
|
|
5944
|
+
"Implement the request using the synthesized specification and coder contract below.",
|
|
5945
|
+
"Do not merely describe the contract: perform the requested work, verify it, and report the result.",
|
|
5946
|
+
"",
|
|
5947
|
+
spec.formattedSpecMarkdown,
|
|
5948
|
+
"",
|
|
5949
|
+
"## Coder Contract",
|
|
5950
|
+
...coder.instructions.map((instruction) => `- ${instruction}`),
|
|
5951
|
+
"[/vibe_protocol]"
|
|
5952
|
+
].join("\n");
|
|
5953
|
+
}
|
|
5954
|
+
function installVibeProtocol(pipelines) {
|
|
5955
|
+
let active;
|
|
5956
|
+
const userInput = {
|
|
5957
|
+
name: "VibeProtocolInput",
|
|
5958
|
+
owner: "sdd",
|
|
5959
|
+
async handler(payload, next) {
|
|
5960
|
+
active = void 0;
|
|
5961
|
+
delete payload.ctx.meta[VIBE_PROTOCOL_META_KEY];
|
|
5962
|
+
if (!hasVibeTag(payload.text)) return next(payload);
|
|
5963
|
+
const rawPrompt = payload.text;
|
|
5964
|
+
const spec = synthesizeVibeSpec(rawPrompt);
|
|
5965
|
+
const coder = buildCoderContract(spec);
|
|
5966
|
+
const contractBlock = { type: "text", text: formatCoderInput(spec, coder) };
|
|
5967
|
+
payload.content = [...payload.content, contractBlock];
|
|
5968
|
+
payload.text = `${payload.text}
|
|
5969
|
+
|
|
5970
|
+
${contractBlock.text}`;
|
|
5971
|
+
active = { rawPrompt, spec, coder, ctx: payload.ctx };
|
|
5972
|
+
payload.ctx.meta[VIBE_PROTOCOL_META_KEY] = {
|
|
5973
|
+
isVibeMode: true,
|
|
5974
|
+
stage: "coder",
|
|
5975
|
+
synthesizer: spec,
|
|
5976
|
+
coder
|
|
5977
|
+
};
|
|
5978
|
+
return next(payload);
|
|
5979
|
+
}
|
|
5980
|
+
};
|
|
5981
|
+
const response = {
|
|
5982
|
+
name: "VibeProtocolAuditor",
|
|
5983
|
+
owner: "sdd",
|
|
5984
|
+
async handler(value, next) {
|
|
5985
|
+
const run = active;
|
|
5986
|
+
if (!run || value.content.some((block) => block.type === "tool_use")) return next(value);
|
|
5987
|
+
const coderOutput = value.content.filter((block) => block.type === "text").map((block) => block.text).join("\n").trim();
|
|
5988
|
+
if (!coderOutput) return next(value);
|
|
5989
|
+
const audit = auditVibeExecution({
|
|
5990
|
+
rawPrompt: run.rawPrompt,
|
|
5991
|
+
spec: run.spec,
|
|
5992
|
+
coderOutput
|
|
5993
|
+
});
|
|
5994
|
+
const markdown = formatVibeReport(run.rawPrompt, run.spec, run.coder, audit);
|
|
5995
|
+
const report = {
|
|
5996
|
+
isVibeMode: true,
|
|
5997
|
+
stage: audit.verdict === "PASS" ? "passed" : "auditor",
|
|
5998
|
+
synthesizer: run.spec,
|
|
5999
|
+
coder: run.coder,
|
|
6000
|
+
audit,
|
|
6001
|
+
markdown
|
|
6002
|
+
};
|
|
6003
|
+
active = void 0;
|
|
6004
|
+
run.ctx.meta[VIBE_PROTOCOL_META_KEY] = report;
|
|
6005
|
+
return next({
|
|
6006
|
+
...value,
|
|
6007
|
+
content: [...value.content, { type: "text", text: `
|
|
6008
|
+
|
|
6009
|
+
${markdown}` }]
|
|
6010
|
+
});
|
|
6011
|
+
}
|
|
6012
|
+
};
|
|
6013
|
+
pipelines.userInput.use(userInput);
|
|
6014
|
+
pipelines.response.use(response);
|
|
6015
|
+
}
|
|
5928
6016
|
export {
|
|
5929
6017
|
AISpecBuilder,
|
|
5930
6018
|
AutoExecutor,
|
|
@@ -5945,6 +6033,7 @@ export {
|
|
|
5945
6033
|
TaskGenerator,
|
|
5946
6034
|
TaskGraphStore,
|
|
5947
6035
|
TaskTracker3 as TaskTracker,
|
|
6036
|
+
VIBE_PROTOCOL_META_KEY,
|
|
5948
6037
|
analyzeCriticalPath,
|
|
5949
6038
|
applySddLifecycle,
|
|
5950
6039
|
assertSpecTaskGraphCoverage,
|
|
@@ -5969,9 +6058,11 @@ export {
|
|
|
5969
6058
|
gatherProjectContext,
|
|
5970
6059
|
getTemplate,
|
|
5971
6060
|
hasConflictMarkers,
|
|
6061
|
+
installVibeProtocol,
|
|
5972
6062
|
intakeToInterviewKickoff,
|
|
5973
6063
|
isAISpecSession,
|
|
5974
6064
|
isExplanatoryText,
|
|
6065
|
+
isIdentifierLikeExclusion,
|
|
5975
6066
|
listTemplates,
|
|
5976
6067
|
makeAcceptanceCriteriaVerifier,
|
|
5977
6068
|
makeCommandVerifier,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AgentPipelines } from '@wrongstack/core/agent';
|
|
2
|
+
export declare const VIBE_PROTOCOL_META_KEY = "vibeProtocol";
|
|
3
|
+
/**
|
|
4
|
+
* Installs the VIBE protocol on Agent pipelines. CLI/TUI (lifecycle-plugins)
|
|
5
|
+
* and standalone WebUI (createAgentServices) both call this so a tagged user
|
|
6
|
+
* turn receives the synthesized spec and coder contract before the model runs;
|
|
7
|
+
* the first final text response is then audited and receives the report.
|
|
8
|
+
*/
|
|
9
|
+
export declare function installVibeProtocol(pipelines: AgentPipelines): void;
|
|
10
|
+
//# sourceMappingURL=vibe-protocol-wiring.d.ts.map
|
package/dist/vibe-protocol.d.ts
CHANGED
|
@@ -52,6 +52,11 @@ export interface VibeVerificationReport {
|
|
|
52
52
|
audit: VibeAuditVerdict;
|
|
53
53
|
markdown: string;
|
|
54
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Policy sentences are not code artifacts. Only identifier-like exclusions
|
|
57
|
+
* (packages, files, symbols) are safe to substring-match in coder output.
|
|
58
|
+
*/
|
|
59
|
+
export declare function isIdentifierLikeExclusion(excluded: string): boolean;
|
|
55
60
|
/**
|
|
56
61
|
* 1. Spec-Synthesizer: Transforms unstructured, chaotic vibe prompt into a formal spec.
|
|
57
62
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/sdd",
|
|
3
|
-
"version": "0.307.
|
|
3
|
+
"version": "0.307.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "WrongStack Spec-Driven Development engine — standalone package extracted from @wrongstack/core. Task graph generation, tracking, execution, lifecycle management, and AI-driven spec building for SDD workflows.",
|
|
6
6
|
"repository": {
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"!dist/**/*.map"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@wrongstack/
|
|
31
|
-
"@wrongstack/
|
|
32
|
-
"@wrongstack/
|
|
30
|
+
"@wrongstack/requirement-intake": "0.307.1",
|
|
31
|
+
"@wrongstack/kanban": "0.307.1",
|
|
32
|
+
"@wrongstack/core": "0.307.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/node": "^26.2.0",
|