@assistkick/create 1.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.
- package/dist/bin/create.d.ts +2 -0
- package/dist/bin/create.js +25 -0
- package/dist/bin/create.js.map +1 -0
- package/dist/src/scaffolder.d.ts +22 -0
- package/dist/src/scaffolder.js +120 -0
- package/dist/src/scaffolder.js.map +1 -0
- package/package.json +24 -0
- package/templates/product-system/.env.example +8 -0
- package/templates/product-system/CLAUDE.md +45 -0
- package/templates/product-system/package.json +32 -0
- package/templates/product-system/packages/backend/package.json +37 -0
- package/templates/product-system/packages/backend/src/middleware/auth_middleware.test.ts +86 -0
- package/templates/product-system/packages/backend/src/middleware/auth_middleware.ts +35 -0
- package/templates/product-system/packages/backend/src/routes/auth.ts +463 -0
- package/templates/product-system/packages/backend/src/routes/coherence.ts +187 -0
- package/templates/product-system/packages/backend/src/routes/graph.ts +67 -0
- package/templates/product-system/packages/backend/src/routes/kanban.ts +201 -0
- package/templates/product-system/packages/backend/src/routes/pipeline.ts +41 -0
- package/templates/product-system/packages/backend/src/routes/projects.ts +122 -0
- package/templates/product-system/packages/backend/src/routes/users.ts +97 -0
- package/templates/product-system/packages/backend/src/server.ts +159 -0
- package/templates/product-system/packages/backend/src/services/auth_service.test.ts +115 -0
- package/templates/product-system/packages/backend/src/services/auth_service.ts +82 -0
- package/templates/product-system/packages/backend/src/services/coherence-review.ts +339 -0
- package/templates/product-system/packages/backend/src/services/email_service.ts +75 -0
- package/templates/product-system/packages/backend/src/services/init.ts +80 -0
- package/templates/product-system/packages/backend/src/services/invitation_service.test.ts +235 -0
- package/templates/product-system/packages/backend/src/services/invitation_service.ts +193 -0
- package/templates/product-system/packages/backend/src/services/password_reset_service.test.ts +151 -0
- package/templates/product-system/packages/backend/src/services/password_reset_service.ts +135 -0
- package/templates/product-system/packages/backend/src/services/project_service.test.ts +215 -0
- package/templates/product-system/packages/backend/src/services/project_service.ts +171 -0
- package/templates/product-system/packages/backend/src/services/pty_session_manager.test.ts +88 -0
- package/templates/product-system/packages/backend/src/services/pty_session_manager.ts +279 -0
- package/templates/product-system/packages/backend/src/services/terminal_ws_handler.ts +133 -0
- package/templates/product-system/packages/backend/src/services/user_management_service.test.ts +158 -0
- package/templates/product-system/packages/backend/src/services/user_management_service.ts +128 -0
- package/templates/product-system/packages/backend/tsconfig.json +22 -0
- package/templates/product-system/packages/frontend/index.html +13 -0
- package/templates/product-system/packages/frontend/package-lock.json +2666 -0
- package/templates/product-system/packages/frontend/package.json +30 -0
- package/templates/product-system/packages/frontend/public/favicon.svg +16 -0
- package/templates/product-system/packages/frontend/src/App.tsx +29 -0
- package/templates/product-system/packages/frontend/src/api/client.ts +386 -0
- package/templates/product-system/packages/frontend/src/api/client_projects.test.ts +104 -0
- package/templates/product-system/packages/frontend/src/api/client_refresh.test.ts +145 -0
- package/templates/product-system/packages/frontend/src/components/CoherenceView.tsx +414 -0
- package/templates/product-system/packages/frontend/src/components/GraphLegend.tsx +124 -0
- package/templates/product-system/packages/frontend/src/components/GraphSettings.tsx +112 -0
- package/templates/product-system/packages/frontend/src/components/GraphView.tsx +370 -0
- package/templates/product-system/packages/frontend/src/components/InviteUserDialog.tsx +85 -0
- package/templates/product-system/packages/frontend/src/components/KanbanView.tsx +470 -0
- package/templates/product-system/packages/frontend/src/components/LoginPage.tsx +116 -0
- package/templates/product-system/packages/frontend/src/components/ProjectSelector.tsx +187 -0
- package/templates/product-system/packages/frontend/src/components/QaIssueSheet.tsx +192 -0
- package/templates/product-system/packages/frontend/src/components/SidePanel.tsx +231 -0
- package/templates/product-system/packages/frontend/src/components/TerminalView.tsx +200 -0
- package/templates/product-system/packages/frontend/src/components/Toolbar.tsx +84 -0
- package/templates/product-system/packages/frontend/src/components/UsersView.tsx +249 -0
- package/templates/product-system/packages/frontend/src/constants/graph.ts +191 -0
- package/templates/product-system/packages/frontend/src/hooks/useAuth.tsx +54 -0
- package/templates/product-system/packages/frontend/src/hooks/useGraph.ts +27 -0
- package/templates/product-system/packages/frontend/src/hooks/useKanban.ts +21 -0
- package/templates/product-system/packages/frontend/src/hooks/useProjects.ts +86 -0
- package/templates/product-system/packages/frontend/src/hooks/useTheme.ts +26 -0
- package/templates/product-system/packages/frontend/src/hooks/useToast.tsx +62 -0
- package/templates/product-system/packages/frontend/src/hooks/use_projects_logic.test.ts +61 -0
- package/templates/product-system/packages/frontend/src/main.tsx +12 -0
- package/templates/product-system/packages/frontend/src/pages/accept_invitation_page.tsx +167 -0
- package/templates/product-system/packages/frontend/src/pages/forgot_password_page.tsx +100 -0
- package/templates/product-system/packages/frontend/src/pages/register_page.tsx +137 -0
- package/templates/product-system/packages/frontend/src/pages/reset_password_page.tsx +146 -0
- package/templates/product-system/packages/frontend/src/routes/ProtectedRoute.tsx +12 -0
- package/templates/product-system/packages/frontend/src/routes/accept_invitation.tsx +14 -0
- package/templates/product-system/packages/frontend/src/routes/dashboard.tsx +221 -0
- package/templates/product-system/packages/frontend/src/routes/forgot_password.tsx +13 -0
- package/templates/product-system/packages/frontend/src/routes/login.tsx +14 -0
- package/templates/product-system/packages/frontend/src/routes/register.tsx +14 -0
- package/templates/product-system/packages/frontend/src/routes/reset_password.tsx +13 -0
- package/templates/product-system/packages/frontend/src/styles/index.css +3358 -0
- package/templates/product-system/packages/frontend/src/utils/auth_validation.test.ts +51 -0
- package/templates/product-system/packages/frontend/src/utils/auth_validation.ts +19 -0
- package/templates/product-system/packages/frontend/src/utils/login_validation.test.ts +61 -0
- package/templates/product-system/packages/frontend/src/utils/login_validation.ts +24 -0
- package/templates/product-system/packages/frontend/src/utils/logout.test.ts +63 -0
- package/templates/product-system/packages/frontend/src/utils/node_sizing.test.ts +62 -0
- package/templates/product-system/packages/frontend/src/utils/node_sizing.ts +24 -0
- package/templates/product-system/packages/frontend/src/utils/task_status.test.ts +53 -0
- package/templates/product-system/packages/frontend/src/utils/task_status.ts +14 -0
- package/templates/product-system/packages/frontend/tsconfig.json +21 -0
- package/templates/product-system/packages/frontend/vite.config.ts +20 -0
- package/templates/product-system/packages/shared/.env.example +3 -0
- package/templates/product-system/packages/shared/README.md +1 -0
- package/templates/product-system/packages/shared/db/migrate.ts +32 -0
- package/templates/product-system/packages/shared/db/migrations/0000_dashing_gorgon.sql +128 -0
- package/templates/product-system/packages/shared/db/migrations/meta/0000_snapshot.json +819 -0
- package/templates/product-system/packages/shared/db/migrations/meta/_journal.json +13 -0
- package/templates/product-system/packages/shared/db/schema.ts +137 -0
- package/templates/product-system/packages/shared/drizzle.config.js +14 -0
- package/templates/product-system/packages/shared/lib/claude-service.ts +215 -0
- package/templates/product-system/packages/shared/lib/coherence.ts +278 -0
- package/templates/product-system/packages/shared/lib/completeness.ts +30 -0
- package/templates/product-system/packages/shared/lib/constants.ts +327 -0
- package/templates/product-system/packages/shared/lib/db.ts +81 -0
- package/templates/product-system/packages/shared/lib/git_workflow.ts +110 -0
- package/templates/product-system/packages/shared/lib/graph.ts +186 -0
- package/templates/product-system/packages/shared/lib/kanban.ts +161 -0
- package/templates/product-system/packages/shared/lib/markdown.ts +205 -0
- package/templates/product-system/packages/shared/lib/pipeline-state-store.ts +124 -0
- package/templates/product-system/packages/shared/lib/pipeline.ts +489 -0
- package/templates/product-system/packages/shared/lib/prompt_builder.ts +170 -0
- package/templates/product-system/packages/shared/lib/relevance_search.ts +159 -0
- package/templates/product-system/packages/shared/lib/session.ts +152 -0
- package/templates/product-system/packages/shared/lib/validator.ts +117 -0
- package/templates/product-system/packages/shared/lib/work_summary_parser.ts +130 -0
- package/templates/product-system/packages/shared/package.json +30 -0
- package/templates/product-system/packages/shared/scripts/assign-project.ts +52 -0
- package/templates/product-system/packages/shared/tools/add_edge.ts +61 -0
- package/templates/product-system/packages/shared/tools/add_node.ts +101 -0
- package/templates/product-system/packages/shared/tools/end_session.ts +87 -0
- package/templates/product-system/packages/shared/tools/get_gaps.ts +87 -0
- package/templates/product-system/packages/shared/tools/get_kanban.ts +125 -0
- package/templates/product-system/packages/shared/tools/get_node.ts +78 -0
- package/templates/product-system/packages/shared/tools/get_status.ts +98 -0
- package/templates/product-system/packages/shared/tools/migrate_to_turso.ts +385 -0
- package/templates/product-system/packages/shared/tools/move_card.ts +143 -0
- package/templates/product-system/packages/shared/tools/rebuild_index.ts +77 -0
- package/templates/product-system/packages/shared/tools/remove_edge.ts +59 -0
- package/templates/product-system/packages/shared/tools/remove_node.ts +96 -0
- package/templates/product-system/packages/shared/tools/resolve_question.ts +75 -0
- package/templates/product-system/packages/shared/tools/search_nodes.ts +106 -0
- package/templates/product-system/packages/shared/tools/start_session.ts +144 -0
- package/templates/product-system/packages/shared/tools/update_node.ts +133 -0
- package/templates/product-system/packages/shared/tsconfig.json +24 -0
- package/templates/product-system/pnpm-workspace.yaml +2 -0
- package/templates/product-system/smoke_test.ts +219 -0
- package/templates/product-system/tests/coherence_review.test.ts +562 -0
- package/templates/product-system/tests/db_sqlite_fallback.test.ts +75 -0
- package/templates/product-system/tests/edge_type_color_coding.test.ts +147 -0
- package/templates/product-system/tests/emit-tool-use-events.test.ts +85 -0
- package/templates/product-system/tests/feature_kind.test.ts +139 -0
- package/templates/product-system/tests/gap_indicators.test.ts +199 -0
- package/templates/product-system/tests/graceful_init.test.ts +142 -0
- package/templates/product-system/tests/graph_legend.test.ts +314 -0
- package/templates/product-system/tests/graph_settings_sheet.test.ts +804 -0
- package/templates/product-system/tests/hide_defined_filter.test.ts +205 -0
- package/templates/product-system/tests/kanban.test.ts +529 -0
- package/templates/product-system/tests/neighborhood_focus.test.ts +132 -0
- package/templates/product-system/tests/node_search.test.ts +340 -0
- package/templates/product-system/tests/node_sizing.test.ts +170 -0
- package/templates/product-system/tests/node_type_toggle_filters.test.ts +285 -0
- package/templates/product-system/tests/node_type_visual_encoding.test.ts +103 -0
- package/templates/product-system/tests/pipeline-state-store.test.ts +268 -0
- package/templates/product-system/tests/pipeline-unit.test.ts +593 -0
- package/templates/product-system/tests/pipeline.test.ts +195 -0
- package/templates/product-system/tests/pipeline_stats_all_cards.test.ts +193 -0
- package/templates/product-system/tests/play_all.test.ts +296 -0
- package/templates/product-system/tests/qa_issue_sheet.test.ts +464 -0
- package/templates/product-system/tests/relevance_search.test.ts +186 -0
- package/templates/product-system/tests/search_reorder.test.ts +88 -0
- package/templates/product-system/tests/serve_ui.test.ts +281 -0
- package/templates/product-system/tests/serve_ui_drizzle.test.ts +114 -0
- package/templates/product-system/tests/session_context_recall.test.ts +135 -0
- package/templates/product-system/tests/side_panel.test.ts +345 -0
- package/templates/product-system/tests/spec_completeness_label.test.ts +69 -0
- package/templates/product-system/tests/url_routing_test.ts +122 -0
- package/templates/product-system/tests/user_login.test.ts +150 -0
- package/templates/product-system/tests/user_registration.test.ts +205 -0
- package/templates/product-system/tests/web_terminal.test.ts +572 -0
- package/templates/product-system/tests/work_summary.test.ts +211 -0
- package/templates/product-system/tests/zoom_pan.test.ts +43 -0
- package/templates/product-system/tsconfig.json +24 -0
- package/templates/skills/product-bootstrap/SKILL.md +312 -0
- package/templates/skills/product-code-reviewer/SKILL.md +147 -0
- package/templates/skills/product-debugger/SKILL.md +206 -0
- package/templates/skills/product-debugger/references/agent-browser.md +1156 -0
- package/templates/skills/product-developer/SKILL.md +182 -0
- package/templates/skills/product-interview/SKILL.md +220 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Smoke test: require all lib modules, verify exports exist and work.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
NODE_TYPES,
|
|
7
|
+
REQUIRED_SECTIONS,
|
|
8
|
+
VALID_RELATIONS,
|
|
9
|
+
VALID_STATUSES,
|
|
10
|
+
VALID_PRIORITIES,
|
|
11
|
+
SCORING_RULES,
|
|
12
|
+
COMMON_OPTIONAL_SECTIONS,
|
|
13
|
+
} from './packages/shared/lib/constants.js';
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
readGraph,
|
|
17
|
+
writeGraph,
|
|
18
|
+
patchNode,
|
|
19
|
+
addEdge,
|
|
20
|
+
removeEdge,
|
|
21
|
+
nodeExists,
|
|
22
|
+
getNode,
|
|
23
|
+
getProjectRoot,
|
|
24
|
+
} from './packages/shared/lib/graph.js';
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
readNode,
|
|
28
|
+
writeNode,
|
|
29
|
+
getSection,
|
|
30
|
+
setSection,
|
|
31
|
+
appendToSection,
|
|
32
|
+
moveLineAcrossSections,
|
|
33
|
+
deriveMetadata,
|
|
34
|
+
templateSections,
|
|
35
|
+
} from './packages/shared/lib/markdown.js';
|
|
36
|
+
|
|
37
|
+
import { scoreNode } from './packages/shared/lib/completeness.js';
|
|
38
|
+
|
|
39
|
+
import {
|
|
40
|
+
assertNodeExists,
|
|
41
|
+
assertValidType,
|
|
42
|
+
assertValidRelation,
|
|
43
|
+
assertNoDuplicateEdge,
|
|
44
|
+
assertNoCycle,
|
|
45
|
+
assertUniqueName,
|
|
46
|
+
} from './packages/shared/lib/validator.js';
|
|
47
|
+
|
|
48
|
+
let passed = 0;
|
|
49
|
+
let failed = 0;
|
|
50
|
+
|
|
51
|
+
function assert(condition, message) {
|
|
52
|
+
if (condition) {
|
|
53
|
+
passed++;
|
|
54
|
+
} else {
|
|
55
|
+
failed++;
|
|
56
|
+
console.error(`FAIL: ${message}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// --- constants.js ---
|
|
61
|
+
assert(typeof NODE_TYPES === 'object', 'NODE_TYPES is an object');
|
|
62
|
+
assert(Object.keys(NODE_TYPES).length === 12, 'NODE_TYPES has 12 types');
|
|
63
|
+
assert(NODE_TYPES.feature === 'feat', 'feature prefix is feat');
|
|
64
|
+
assert(NODE_TYPES.decision === 'dec', 'decision prefix is dec');
|
|
65
|
+
assert(NODE_TYPES.open_question === 'oq', 'open_question prefix is oq');
|
|
66
|
+
|
|
67
|
+
assert(Array.isArray(VALID_RELATIONS), 'VALID_RELATIONS is an array');
|
|
68
|
+
assert(VALID_RELATIONS.includes('depends_on'), 'depends_on is a valid relation');
|
|
69
|
+
assert(VALID_RELATIONS.includes('governed_by'), 'governed_by is a valid relation');
|
|
70
|
+
assert(VALID_RELATIONS.length === 11, 'VALID_RELATIONS has 11 relations');
|
|
71
|
+
|
|
72
|
+
assert(REQUIRED_SECTIONS.feature.includes('Description'), 'feature requires Description');
|
|
73
|
+
assert(REQUIRED_SECTIONS.feature.includes('Acceptance Criteria'), 'feature requires Acceptance Criteria');
|
|
74
|
+
assert(REQUIRED_SECTIONS.component.includes('Responsibilities'), 'component requires Responsibilities');
|
|
75
|
+
|
|
76
|
+
assert(VALID_STATUSES.includes('draft'), 'draft is a valid status');
|
|
77
|
+
assert(VALID_STATUSES.includes('defined'), 'defined is a valid status');
|
|
78
|
+
|
|
79
|
+
assert(VALID_PRIORITIES.includes('blocking'), 'blocking is a valid priority');
|
|
80
|
+
|
|
81
|
+
assert(typeof SCORING_RULES.feature === 'object', 'feature has scoring rules');
|
|
82
|
+
assert(SCORING_RULES.feature.length === 4, 'feature has 4 scoring rules');
|
|
83
|
+
|
|
84
|
+
// Verify scoring weights sum to 1.0 for each type
|
|
85
|
+
for (const [type, rules] of Object.entries(SCORING_RULES)) {
|
|
86
|
+
const sum = rules.reduce((s, r) => s + r.weight, 0);
|
|
87
|
+
assert(Math.abs(sum - 1.0) < 0.01, `${type} scoring weights sum to ~1.0 (got ${sum})`);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// --- graph.js ---
|
|
91
|
+
assert(typeof readGraph === 'function', 'readGraph is a function');
|
|
92
|
+
assert(typeof writeGraph === 'function', 'writeGraph is a function');
|
|
93
|
+
assert(typeof patchNode === 'function', 'patchNode is a function');
|
|
94
|
+
assert(typeof addEdge === 'function', 'addEdge is a function');
|
|
95
|
+
assert(typeof removeEdge === 'function', 'removeEdge is a function');
|
|
96
|
+
assert(typeof nodeExists === 'function', 'nodeExists is a function');
|
|
97
|
+
assert(typeof getNode === 'function', 'getNode is a function');
|
|
98
|
+
assert(typeof getProjectRoot === 'function', 'getProjectRoot is a function');
|
|
99
|
+
|
|
100
|
+
// Test reading a non-existent graph returns empty structure
|
|
101
|
+
const emptyGraph = readGraph();
|
|
102
|
+
assert(emptyGraph.version === '1.0', 'empty graph has version 1.0');
|
|
103
|
+
assert(Array.isArray(emptyGraph.nodes), 'empty graph has nodes array');
|
|
104
|
+
assert(Array.isArray(emptyGraph.edges), 'empty graph has edges array');
|
|
105
|
+
assert(emptyGraph.nodes.length === 0, 'empty graph has no nodes');
|
|
106
|
+
|
|
107
|
+
// --- markdown.js ---
|
|
108
|
+
assert(typeof readNode === 'function', 'readNode is a function');
|
|
109
|
+
assert(typeof writeNode === 'function', 'writeNode is a function');
|
|
110
|
+
assert(typeof getSection === 'function', 'getSection is a function');
|
|
111
|
+
assert(typeof setSection === 'function', 'setSection is a function');
|
|
112
|
+
assert(typeof appendToSection === 'function', 'appendToSection is a function');
|
|
113
|
+
assert(typeof moveLineAcrossSections === 'function', 'moveLineAcrossSections is a function');
|
|
114
|
+
assert(typeof deriveMetadata === 'function', 'deriveMetadata is a function');
|
|
115
|
+
assert(typeof templateSections === 'function', 'templateSections is a function');
|
|
116
|
+
|
|
117
|
+
// Test templateSections
|
|
118
|
+
const featSections = templateSections('feature');
|
|
119
|
+
assert('Description' in featSections, 'feature template has Description');
|
|
120
|
+
assert('Acceptance Criteria' in featSections, 'feature template has Acceptance Criteria');
|
|
121
|
+
assert('Open Questions' in featSections, 'feature template has Open Questions');
|
|
122
|
+
assert('Resolved Questions' in featSections, 'feature template has Resolved Questions (optional)');
|
|
123
|
+
|
|
124
|
+
// --- completeness.js ---
|
|
125
|
+
assert(typeof scoreNode === 'function', 'scoreNode is a function');
|
|
126
|
+
|
|
127
|
+
// Test scoring with empty sections — only "no open questions" passes (+0.3)
|
|
128
|
+
const emptyScore = scoreNode('feature', { status: 'draft' }, {});
|
|
129
|
+
assert(emptyScore === 0.3, `empty feature scores 0.3 (got ${emptyScore})`);
|
|
130
|
+
|
|
131
|
+
// Test scoring with partial content (desc + AC + has open questions = 0.2 + 0.3 = 0.5)
|
|
132
|
+
const partialScore = scoreNode('feature', { status: 'draft' }, {
|
|
133
|
+
'Description': 'This is a long enough description that should pass the fifty character check easily.',
|
|
134
|
+
'Acceptance Criteria': '- Must work correctly',
|
|
135
|
+
'Open Questions': '- [ ] What about edge cases?',
|
|
136
|
+
});
|
|
137
|
+
assert(partialScore === 0.5, `partial feature scores 0.5 (got ${partialScore})`);
|
|
138
|
+
|
|
139
|
+
// Test scoring with full content
|
|
140
|
+
const fullScore = scoreNode('feature', { status: 'defined' }, {
|
|
141
|
+
'Description': 'This is a long enough description that should pass the fifty character check easily.',
|
|
142
|
+
'Acceptance Criteria': '- Must work correctly',
|
|
143
|
+
'Open Questions': '',
|
|
144
|
+
});
|
|
145
|
+
assert(fullScore === 1.0, `full feature scores 1.0 (got ${fullScore})`);
|
|
146
|
+
|
|
147
|
+
// --- validator.js ---
|
|
148
|
+
assert(typeof assertNodeExists === 'function', 'assertNodeExists is a function');
|
|
149
|
+
assert(typeof assertValidType === 'function', 'assertValidType is a function');
|
|
150
|
+
assert(typeof assertValidRelation === 'function', 'assertValidRelation is a function');
|
|
151
|
+
assert(typeof assertNoDuplicateEdge === 'function', 'assertNoDuplicateEdge is a function');
|
|
152
|
+
assert(typeof assertNoCycle === 'function', 'assertNoCycle is a function');
|
|
153
|
+
assert(typeof assertUniqueName === 'function', 'assertUniqueName is a function');
|
|
154
|
+
|
|
155
|
+
// Test assertValidType
|
|
156
|
+
try {
|
|
157
|
+
assertValidType('feature');
|
|
158
|
+
passed++;
|
|
159
|
+
} catch {
|
|
160
|
+
failed++;
|
|
161
|
+
console.error('FAIL: assertValidType should accept feature');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
try {
|
|
165
|
+
assertValidType('invalid_type');
|
|
166
|
+
failed++;
|
|
167
|
+
console.error('FAIL: assertValidType should reject invalid_type');
|
|
168
|
+
} catch {
|
|
169
|
+
passed++;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Test assertValidRelation
|
|
173
|
+
try {
|
|
174
|
+
assertValidRelation('depends_on');
|
|
175
|
+
passed++;
|
|
176
|
+
} catch {
|
|
177
|
+
failed++;
|
|
178
|
+
console.error('FAIL: assertValidRelation should accept depends_on');
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
try {
|
|
182
|
+
assertValidRelation('invalid_relation');
|
|
183
|
+
failed++;
|
|
184
|
+
console.error('FAIL: assertValidRelation should reject invalid_relation');
|
|
185
|
+
} catch {
|
|
186
|
+
passed++;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Test section manipulation
|
|
190
|
+
const testSections = { 'Open Questions': '- [ ] Question 1\n- [ ] Question 2' };
|
|
191
|
+
setSection(testSections, 'Notes', 'Some notes');
|
|
192
|
+
assert(testSections['Notes'] === 'Some notes', 'setSection works');
|
|
193
|
+
|
|
194
|
+
appendToSection(testSections, 'Notes', 'More notes');
|
|
195
|
+
assert(testSections['Notes'] === 'Some notes\nMore notes', 'appendToSection works');
|
|
196
|
+
|
|
197
|
+
const moved = moveLineAcrossSections(testSections, 'Open Questions', 'Resolved Questions', 'Question 1');
|
|
198
|
+
assert(moved === true, 'moveLineAcrossSections returns true on match');
|
|
199
|
+
assert(!testSections['Open Questions'].includes('Question 1'), 'line removed from source');
|
|
200
|
+
assert(testSections['Resolved Questions'].includes('Question 1'), 'line added to target');
|
|
201
|
+
|
|
202
|
+
// Test deriveMetadata
|
|
203
|
+
const meta = deriveMetadata({ status: 'draft' }, {
|
|
204
|
+
'Description': 'This is a long enough description that should pass the fifty character check easily.',
|
|
205
|
+
'Acceptance Criteria': '- Must work correctly',
|
|
206
|
+
'Open Questions': '- [ ] Unanswered question',
|
|
207
|
+
}, 'feature');
|
|
208
|
+
assert(meta.completeness === 0.5, `deriveMetadata completeness is 0.5 (got ${meta.completeness})`);
|
|
209
|
+
assert(meta.open_questions_count === 1, `deriveMetadata oq count is 1 (got ${meta.open_questions_count})`);
|
|
210
|
+
assert(meta.status === 'partially_defined', `deriveMetadata status is partially_defined (got ${meta.status})`);
|
|
211
|
+
|
|
212
|
+
// Summary
|
|
213
|
+
console.log(`\n${'='.repeat(40)}`);
|
|
214
|
+
console.log(`Smoke test results: ${passed} passed, ${failed} failed`);
|
|
215
|
+
console.log(`${'='.repeat(40)}`);
|
|
216
|
+
|
|
217
|
+
if (failed > 0) {
|
|
218
|
+
process.exit(1);
|
|
219
|
+
}
|