snipara-companion 3.0.4 → 3.0.5
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 +22 -8
- package/docs/FULL_REFERENCE.md +5 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10941,8 +10941,12 @@ function completeTeamSyncWorkFromEvidence(state, options = {}) {
|
|
|
10941
10941
|
const workflowGoalText = normalizeCompletionText(options.workflowGoal);
|
|
10942
10942
|
const summaryText = normalizeCompletionText(options.summary);
|
|
10943
10943
|
const evidenceFiles = normalizeFiles(options.files);
|
|
10944
|
-
const
|
|
10945
|
-
|
|
10944
|
+
const activeCandidates = state.work.filter((item) => item.status === "active");
|
|
10945
|
+
const directCandidates = activeCandidates.filter(
|
|
10946
|
+
(item) => matchesDirectCompletionEvidence(item, { workflowGoalText, summaryText })
|
|
10947
|
+
);
|
|
10948
|
+
const candidates = directCandidates.length > 0 ? directCandidates : activeCandidates.filter(
|
|
10949
|
+
(item) => matchesCompletionEvidence(item, { workflowGoalText, summaryText, files: evidenceFiles })
|
|
10946
10950
|
);
|
|
10947
10951
|
if (!options.dryRun) {
|
|
10948
10952
|
for (const item of candidates) {
|
|
@@ -12224,6 +12228,9 @@ function resolveRootDir(dir) {
|
|
|
12224
12228
|
return path15.resolve(dir ?? process.cwd());
|
|
12225
12229
|
}
|
|
12226
12230
|
function matchesCompletionEvidence(item, evidence) {
|
|
12231
|
+
if (matchesDirectCompletionEvidence(item, evidence)) {
|
|
12232
|
+
return true;
|
|
12233
|
+
}
|
|
12227
12234
|
const itemText = normalizeCompletionText(item.summary);
|
|
12228
12235
|
if (!itemText) {
|
|
12229
12236
|
return false;
|
|
@@ -12231,16 +12238,23 @@ function matchesCompletionEvidence(item, evidence) {
|
|
|
12231
12238
|
const evidenceTexts = [evidence.workflowGoalText, evidence.summaryText].filter(
|
|
12232
12239
|
(value) => Boolean(value)
|
|
12233
12240
|
);
|
|
12234
|
-
if (
|
|
12235
|
-
return true;
|
|
12236
|
-
}
|
|
12237
|
-
if (evidence.workflowGoalText) {
|
|
12241
|
+
if (!teamSyncFilesOverlap(item.files, evidence.files)) {
|
|
12238
12242
|
return false;
|
|
12239
12243
|
}
|
|
12240
|
-
|
|
12244
|
+
return evidenceTexts.some((text) => significantTokenOverlap(itemText, text));
|
|
12245
|
+
}
|
|
12246
|
+
function matchesDirectCompletionEvidence(item, evidence) {
|
|
12247
|
+
const itemText = normalizeCompletionText(item.summary);
|
|
12248
|
+
if (!itemText) {
|
|
12241
12249
|
return false;
|
|
12242
12250
|
}
|
|
12243
|
-
|
|
12251
|
+
const evidenceTexts = [evidence.workflowGoalText, evidence.summaryText].filter(
|
|
12252
|
+
(value) => Boolean(value)
|
|
12253
|
+
);
|
|
12254
|
+
if (evidenceTexts.some((text) => completionTextsMatch(itemText, text))) {
|
|
12255
|
+
return true;
|
|
12256
|
+
}
|
|
12257
|
+
return false;
|
|
12244
12258
|
}
|
|
12245
12259
|
function normalizeCompletionText(value) {
|
|
12246
12260
|
const normalized = value?.toLowerCase().replace(/[^a-z0-9]+/g, " ").replace(/\s+/g, " ").trim();
|
package/docs/FULL_REFERENCE.md
CHANGED
|
@@ -232,7 +232,10 @@ longer timeout, retries once with a shorter summary on transient hosted failures
|
|
|
232
232
|
and then records a local fallback handoff in `.snipara/team-sync/session.json`
|
|
233
233
|
if the hosted call still times out. A hosted final-commit timeout does not modify
|
|
234
234
|
Git state. Custom final-commit categories are namespaced under `final-commit`
|
|
235
|
-
before the hosted call so they stay on the handoff-only path.
|
|
235
|
+
before the hosted call so they stay on the handoff-only path. Completed workflow
|
|
236
|
+
commits also reconcile local Team Sync work: exact goal/summary matches close
|
|
237
|
+
directly, and slug-like workflow goals can still close the matching active work
|
|
238
|
+
when touched files overlap and meaningful workflow tokens match.
|
|
236
239
|
|
|
237
240
|
## Adaptive Work Routing
|
|
238
241
|
|
|
@@ -961,6 +964,7 @@ Semantics:
|
|
|
961
964
|
- `snipara-companion workflow phase-start` = marks the current phase and prints the required Snipara context gate plus code-impact / symbol-card gates; runtime-marked phases also get a stable Snipara Sandbox session binding
|
|
962
965
|
- `snipara-companion workflow runtime-checkpoint` = captures a resume-ready Snipara Sandbox checkpoint for one phase using local workflow state plus a hosted automation event when configured
|
|
963
966
|
- `snipara-companion workflow phase-commit` = calls hosted `snipara_end_of_task_commit` for that phase, updates local state, and advances the next phase; if the hosted commit times out or hits a transient network failure, local workflow state still advances with an explicit local fallback record
|
|
967
|
+
- `snipara-companion workflow phase-commit` and `workflow final-commit` also complete matching local Team Sync active work when the workflow is completed. Matching is conservative: exact workflow goal/summary text wins, and file overlap plus meaningful token overlap handles slug-like workflow goals without closing unrelated active work.
|
|
964
968
|
- `snipara-companion workflow impact-gate` = local pre-push gate for completed workflow phases in `upstream..HEAD`; it keeps dirty files out of the committed impact analysis and reports phase/file coverage before hosted reindex catches up
|
|
965
969
|
- `snipara-companion workflow resume` = reloads local workflow state plus hosted durable memory after compaction or resume, optionally includes short-lived session context with `--include-session-context`, then appends the latest hosted Team Sync handoff/checkpoint context when available; runtime-bound phases also print a Snipara Sandbox reattach or rehydrate plan; rerun `workflow phase-start` before editing again
|
|
966
970
|
- `snipara-companion workflow resume` does not snapshot or exactly restore a live Snipara Sandbox process; exact process restore remains a roadmap item
|