opencode-swarm 7.179.1 → 7.180.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/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/agents/architect.d.ts +67 -0
- package/dist/agents/council-prompts.d.ts +3 -3
- package/dist/agents/index.d.ts +1 -1
- package/dist/background/pr-event-subscribers.d.ts +2 -0
- package/dist/background/pr-feedback-event-queue.d.ts +7 -0
- package/dist/background/pr-feedback-loop.d.ts +162 -0
- package/dist/cli/{coder-settlement-f1nmezzv.js → coder-settlement-b57917a3.js} +14 -14
- package/dist/cli/{config-doctor-ena2803f.js → config-doctor-ebat06eq.js} +2 -2
- package/dist/cli/{core-fcfzme3m.js → core-8k41qh0d.js} +4 -5
- package/dist/cli/{curation-policy-c7mdsf7m.js → curation-policy-m3x9mkj9.js} +7 -6
- package/dist/cli/{curator-q9s5q9v4.js → curator-8yb3qkxs.js} +45 -43
- package/dist/cli/{curator-drift-d93pwt8h.js → curator-drift-3av9hffm.js} +22 -12
- package/dist/cli/curator-llm-factory-htgqafq0.js +74 -0
- package/dist/cli/{evidence-summary-service-wtj8mkm6.js → evidence-summary-service-s258ea5t.js} +23 -21
- package/dist/cli/{gate-evidence-h83yb8nd.js → gate-evidence-fqxpf3xz.js} +9 -9
- package/dist/cli/guardrail-explain-r0qxa4zy.js +75 -0
- package/dist/cli/{guardrail-log-zf1htf1d.js → guardrail-log-j2wdmvmy.js} +7 -7
- package/dist/cli/{guardrail-reset-f2p198j3.js → guardrail-reset-wb2eqbvf.js} +45 -43
- package/dist/cli/hive-promoter-kxpc3r17.js +89 -0
- package/dist/cli/{index-wrt875kh.js → index-0725jpp7.js} +1 -1
- package/dist/cli/{index-34bwqcea.js → index-12ewkms0.js} +1 -1
- package/dist/cli/{index-epfjc1c1.js → index-2q5m4m2r.js} +11 -11
- package/dist/cli/{index-h59vsbch.js → index-38cfx8g8.js} +2 -2
- package/dist/cli/{index-xy7k7f3k.js → index-3bbjpbmn.js} +2 -2
- package/dist/cli/{index-vp9pn7sv.js → index-3zvp7t5d.js} +5 -5
- package/dist/cli/{index-dz12bshh.js → index-50v672wd.js} +8 -8
- package/dist/cli/{index-yfpswnjt.js → index-516j9vsk.js} +4 -4
- package/dist/cli/{index-w4c2repz.js → index-600aqfvm.js} +47 -43
- package/dist/cli/{index-0h3cr7pn.js → index-6gcxgx84.js} +1 -1
- package/dist/cli/{index-qt0793qm.js → index-6mwha20t.js} +3 -3
- package/dist/cli/{index-93nx95me.js → index-855qxtdm.js} +8 -7
- package/dist/cli/{index-cvg402ha.js → index-91dhg3wr.js} +2 -2
- package/dist/cli/{index-3pzwsesm.js → index-92m05mew.js} +2 -2
- package/dist/cli/{index-ne9zamcs.js → index-989v83pb.js} +1 -1
- package/dist/cli/{index-9fb01jk5.js → index-as4xaams.js} +1 -1
- package/dist/cli/{index-2b0ktpbf.js → index-bdpgfep1.js} +5 -5
- package/dist/cli/{index-q375xdcw.js → index-bhmrgbyv.js} +9 -1
- package/dist/cli/{index-nzekzzs2.js → index-bv4b8tpa.js} +5 -5
- package/dist/cli/{index-rb9jmj30.js → index-cj64vp08.js} +7 -7
- package/dist/cli/{index-549wxbe1.js → index-cjapb4hy.js} +1 -1
- package/dist/cli/{index-5d224akk.js → index-dzm5nfh7.js} +4 -4
- package/dist/cli/{index-f2v90gfc.js → index-ea9fk6v0.js} +25 -166
- package/dist/cli/index-ejhxgyvm.js +147 -0
- package/dist/cli/{index-n1tcj1q7.js → index-g062wnw1.js} +187 -47
- package/dist/cli/{index-s4bkey0q.js → index-gc6h1fmf.js} +4 -4
- package/dist/cli/{index-pn023bf9.js → index-gw5egd8j.js} +49 -47
- package/dist/cli/index-gx2vp8gx.js +100 -0
- package/dist/cli/{index-yp25bc9n.js → index-gy3tcmk4.js} +7 -7
- package/dist/cli/{index-n2wjrgcs.js → index-k5vwnnym.js} +7 -9
- package/dist/cli/{index-ajm7ebyd.js → index-k6f0nryj.js} +2 -2
- package/dist/cli/{index-zbhvr9st.js → index-n5carmk0.js} +8 -10
- package/dist/cli/{index-h4nh6s8b.js → index-nhxykfyy.js} +1 -1
- package/dist/cli/{index-pskba939.js → index-rejpbgxp.js} +1 -1
- package/dist/cli/{index-9s1xzvnn.js → index-rp4akjrm.js} +13 -3
- package/dist/cli/{index-g6nyk713.js → index-s0zgz4p1.js} +1 -1
- package/dist/cli/{index-aqpwm350.js → index-tnhk72rs.js} +3 -3
- package/dist/cli/{index-sj29n50e.js → index-v0par978.js} +7 -7
- package/dist/cli/index-v7fx8q3z.js +339 -0
- package/dist/cli/{index-a11ztzs5.js → index-vmthakz0.js} +1 -1
- package/dist/cli/{index-b567t0cr.js → index-wx3wz7ya.js} +10 -8
- package/dist/cli/{index-y98fvmb8.js → index-xd0e4amf.js} +33 -18
- package/dist/cli/{index-m1w40kfw.js → index-xj5z92qz.js} +4 -103
- package/dist/cli/{index-6r92fw88.js → index-y30y1rkg.js} +9 -9
- package/dist/cli/{index-pfg3jwe9.js → index-yf7tdhpz.js} +3 -3
- package/dist/cli/{index-y94vwx2q.js → index-z2xf153n.js} +13 -15
- package/dist/cli/{index-ky262b73.js → index-z2zrcecq.js} +1721 -902
- package/dist/cli/{index-zz7gzw57.js → index-zxdawwc7.js} +88 -4
- package/dist/cli/index.js +46 -44
- package/dist/cli/{knowledge-escalator-z6tkgrjq.js → knowledge-escalator-n30h6ran.js} +17 -16
- package/dist/cli/{knowledge-events-2bgefatz.js → knowledge-events-k2qqase2.js} +15 -14
- package/dist/cli/{knowledge-link-gfz47ves.js → knowledge-link-s2qs178z.js} +6 -5
- package/dist/cli/{knowledge-store-1fphg9sa.js → knowledge-store-zy226v5a.js} +7 -6
- package/dist/cli/{knowledge-validator-723h2vck.js → knowledge-validator-qgyxdpc9.js} +9 -8
- package/dist/cli/{mcp-xyswgya5.js → mcp-pj7acze3.js} +1 -1
- package/dist/cli/{pending-delegations-5zm19yvv.js → pending-delegations-sgnnyw55.js} +14 -13
- package/dist/cli/{pr-subscriptions-5hm6hzv6.js → pr-subscriptions-7fb7xm3q.js} +14 -13
- package/dist/cli/{pr-workflow-gate-48rzb2bh.js → pr-workflow-gate-5dqcrkz6.js} +47 -43
- package/dist/cli/{runner-16b691ba.js → runner-p9hstpxn.js} +7 -6
- package/dist/cli/{scan-cursor-m28tddrg.js → scan-cursor-jc7wwb7e.js} +9 -9
- package/dist/cli/{schema-jt9axyj6.js → schema-5k68crjb.js} +3 -1
- package/dist/cli/{scope-persistence-d0358pw7.js → scope-persistence-xeg4khwk.js} +19 -18
- package/dist/cli/{server-d5jxcbxz.js → server-ej6tzd7t.js} +53 -51
- package/dist/cli/{skill-generator-qanka67x.js → skill-generator-nspt9b3n.js} +19 -18
- package/dist/cli/{snapshot-coordination-init-mhrq11p8.js → snapshot-coordination-init-3rs3zpaa.js} +45 -43
- package/dist/cli/speckit-checkoff-dqf636ya.js +31 -0
- package/dist/cli/{telemetry-qxav5cdk.js → telemetry-zhcgfe70.js} +1 -1
- package/dist/cli/{workspace-snapshot-rfnn80dg.js → workspace-snapshot-4m2ex1ey.js} +4 -5
- package/dist/cli/{worktree-collision-ownership-ygdbpexh.js → worktree-collision-ownership-rbzgbvj4.js} +17 -17
- package/dist/cli/{worktree-isolation-4855f2az.js → worktree-isolation-6zpnzr70.js} +45 -43
- package/dist/commands/pr-feedback-loop.d.ts +1 -0
- package/dist/commands/registry.d.ts +10 -2
- package/dist/config/schema.d.ts +27 -0
- package/dist/council/disagreement-detector.d.ts +23 -1
- package/dist/council/general-council-service.d.ts +40 -3
- package/dist/failures/invocation-failure.d.ts +11 -0
- package/dist/hooks/delegation-tracker.d.ts +6 -1
- package/dist/hooks/pr-workflow-gate.d.ts +1 -1
- package/dist/hooks/system-enhancer.d.ts +4 -2
- package/dist/hooks/system-render-boundary.d.ts +68 -0
- package/dist/index.js +634 -606
- package/dist/sdd/effective-spec.d.ts +35 -22
- package/dist/sdd/speckit-checkoff.d.ts +113 -0
- package/dist/session/hydration-ownership.d.ts +83 -0
- package/dist/session/snapshot-coordination-init.d.ts +2 -1
- package/dist/session/snapshot-reader.d.ts +25 -7
- package/dist/state.d.ts +32 -2
- package/dist/utils/provider-error-classification.d.ts +11 -0
- package/opencode-swarm.schema.json +40 -0
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-dds2fnhj.js +0 -72
- package/dist/cli/guardrail-explain-qm5wej7v.js +0 -73
- package/dist/cli/hive-promoter-1mhx2jh0.js +0 -87
- package/dist/cli/index-4ddpvd5c.js +0 -94
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
validateSwarmPath
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-gc6h1fmf.js";
|
|
5
5
|
import {
|
|
6
6
|
bunSpawn
|
|
7
7
|
} from "./index-2s7dvzff.js";
|
|
8
|
-
import {
|
|
9
|
-
atomicWriteSwarmFileSync
|
|
10
|
-
} from "./index-ne9zamcs.js";
|
|
11
8
|
import {
|
|
12
9
|
canonicalRootKeyFresh
|
|
13
10
|
} from "./index-1xnse449.js";
|
|
14
11
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from "./index-zz7gzw57.js";
|
|
12
|
+
atomicWriteSwarmFileSync
|
|
13
|
+
} from "./index-989v83pb.js";
|
|
18
14
|
import {
|
|
19
15
|
advisoryWarn,
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
init_git_executable,
|
|
17
|
+
init_warning_buffer,
|
|
18
|
+
resolveGitExecutable
|
|
19
|
+
} from "./index-zxdawwc7.js";
|
|
22
20
|
import {
|
|
23
21
|
SWARM_WORKTREE_DIR_NAME,
|
|
24
22
|
init_constants
|
|
@@ -244,7 +242,7 @@ var _internals2 = {
|
|
|
244
242
|
symlinkSync: fs2.symlinkSync
|
|
245
243
|
},
|
|
246
244
|
writeScopeToDisk: async (directory, taskId, files) => {
|
|
247
|
-
const { writeScopeToDisk: realWrite } = await import("./scope-persistence-
|
|
245
|
+
const { writeScopeToDisk: realWrite } = await import("./scope-persistence-xeg4khwk.js");
|
|
248
246
|
return realWrite(directory, taskId, files);
|
|
249
247
|
},
|
|
250
248
|
writeLaneProfileToDisk: async (_worktreePath, _laneIndex, _envOverrides) => {
|
|
@@ -21,7 +21,7 @@ var package_default;
|
|
|
21
21
|
var init_package = __esm(() => {
|
|
22
22
|
package_default = {
|
|
23
23
|
name: "opencode-swarm",
|
|
24
|
-
version: "7.
|
|
24
|
+
version: "7.180.1",
|
|
25
25
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
26
26
|
main: "dist/index.js",
|
|
27
27
|
types: "dist/index.d.ts",
|
|
@@ -327,7 +327,7 @@ function resolveExternalSkillsConfig(input) {
|
|
|
327
327
|
};
|
|
328
328
|
return merged;
|
|
329
329
|
}
|
|
330
|
-
var _internals, SEPARATORS, CANONICAL_ROLES_LONGEST_FIRST, CANONICAL_ROLES_SET, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX = 3, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_SECTION_SCHEMAS, GateConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GATE_CONFIG_READERS, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, RetentionConfigSchema, ReviewPassesConfigSchema, AUTO_REVIEW_V8_BURN_IN_DECISION, AutoReviewFinalConfigSchema, AutoReviewConfigObjectSchema, AutoReviewConfigSchema, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchemaBase, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, GitConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, INVALID_CHECKPOINT_PROTO_FIELD = "__swarm_invalid_checkpoint_proto__", FORBIDDEN_CHECKPOINT_CONFIG_KEYS, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchemaBase, AutomationConfigSchema, KnowledgeConfigSchema, LearningConfigSchema, ConsensusConfigSchema, OtlpExportConfigSchema, ObservabilityConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationAudienceSchema, SkillPropagationConfigSchema, HarnessRelativePathSchema, HarnessEvolutionConfigSchema, DEFAULT_HARNESS_EVOLUTION_CONFIG, SkillImproverConfigSchema, SkillsConfigSchema, SkillOptConfigSchema, DEFAULT_SKILL_OPT_CONFIG, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilMemberConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, DEFAULT_PR_REVIEW_RESILIENCE_CONFIG, PrReviewResilienceConfigSchema, ReviewRoutingConfigSchema, DEFAULT_REVIEW_ROUTING_CONFIG, LaneLivenessWatchdogConfigSchema, DispatchProtectionConfigSchema, DashboardConfigSchema, DEFAULT_PR_REVIEW_LEGACY_TRANSCRIPT_COMPATIBILITY = false, PluginConfigSchema;
|
|
330
|
+
var _internals, SEPARATORS, CANONICAL_ROLES_LONGEST_FIRST, CANONICAL_ROLES_SET, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX = 3, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_SECTION_SCHEMAS, GateConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GATE_CONFIG_READERS, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, RetentionConfigSchema, ReviewPassesConfigSchema, AUTO_REVIEW_V8_BURN_IN_DECISION, AutoReviewFinalConfigSchema, AutoReviewConfigObjectSchema, AutoReviewConfigSchema, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchemaBase, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, GitConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, INVALID_CHECKPOINT_PROTO_FIELD = "__swarm_invalid_checkpoint_proto__", FORBIDDEN_CHECKPOINT_CONFIG_KEYS, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchemaBase, AutomationConfigSchema, KnowledgeConfigSchema, LearningConfigSchema, ConsensusConfigSchema, OtlpExportConfigSchema, ObservabilityConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationAudienceSchema, SkillPropagationConfigSchema, HarnessRelativePathSchema, HarnessEvolutionConfigSchema, DEFAULT_HARNESS_EVOLUTION_CONFIG, SkillImproverConfigSchema, SkillsConfigSchema, SkillOptConfigSchema, DEFAULT_SKILL_OPT_CONFIG, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilMemberConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, PrFeedbackLoopConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, DEFAULT_PR_REVIEW_RESILIENCE_CONFIG, PrReviewResilienceConfigSchema, ReviewRoutingConfigSchema, DEFAULT_REVIEW_ROUTING_CONFIG, LaneLivenessWatchdogConfigSchema, DispatchProtectionConfigSchema, DashboardConfigSchema, DEFAULT_PR_REVIEW_LEGACY_TRANSCRIPT_COMPATIBILITY = false, PluginConfigSchema;
|
|
331
331
|
var init_schema = __esm(() => {
|
|
332
332
|
init_zod();
|
|
333
333
|
init_package();
|
|
@@ -1489,6 +1489,12 @@ var init_schema = __esm(() => {
|
|
|
1489
1489
|
event_delivery: exports_external.enum(["advisory", "prompt"]).default("prompt"),
|
|
1490
1490
|
auto_subscribe_on_pr_create: exports_external.boolean().default(true)
|
|
1491
1491
|
}).strict();
|
|
1492
|
+
PrFeedbackLoopConfigSchema = exports_external.object({
|
|
1493
|
+
enabled: exports_external.boolean().default(false),
|
|
1494
|
+
max_actions_per_pr: exports_external.number().int().min(1).max(10).default(3),
|
|
1495
|
+
max_session_actions: exports_external.number().int().min(1).max(50).default(10),
|
|
1496
|
+
publication: exports_external.enum(["none"]).default("none")
|
|
1497
|
+
});
|
|
1492
1498
|
ParallelizationConfigSchema = exports_external.object({
|
|
1493
1499
|
enabled: exports_external.boolean().default(false),
|
|
1494
1500
|
maxConcurrentTasks: exports_external.number().int().min(1).max(64).default(1),
|
|
@@ -1748,6 +1754,9 @@ var init_schema = __esm(() => {
|
|
|
1748
1754
|
integration_analysis: IntegrationAnalysisConfigSchema.optional().describe("Integration analysis settings."),
|
|
1749
1755
|
docs: DocsConfigSchema.optional().describe("Documentation synthesizer (docs agent) settings."),
|
|
1750
1756
|
design_docs: DesignDocsConfigSchema.optional().describe("Structured design-doc generation (issue #1080, docs_design agent) \u2014 opt-in."),
|
|
1757
|
+
speckit_checkoff: exports_external.object({
|
|
1758
|
+
enabled: exports_external.boolean().default(false).describe("Check off mapped Spec-Kit tasks in the source tasks.md when Swarm completes a plan task (issue #2501). Off by default \u2014 write-back to user-owned files is opt-in.")
|
|
1759
|
+
}).optional().describe("Spec-Kit tasks.md check-off round trip (issue #2501) \u2014 opt-in, never on by default."),
|
|
1751
1760
|
git: GitConfigSchema.optional().describe("Git executable resolution override (issue #2236 hardening)."),
|
|
1752
1761
|
ui_review: UIReviewConfigSchema.optional().describe("UI/UX review (designer agent) settings."),
|
|
1753
1762
|
compaction_advisory: CompactionAdvisoryConfigSchema.optional().describe("Compaction advisory settings."),
|
|
@@ -1949,6 +1958,7 @@ var init_schema = __esm(() => {
|
|
|
1949
1958
|
cleanup_timeout_ms: 2000
|
|
1950
1959
|
}
|
|
1951
1960
|
})).describe("Full-auto autonomous orchestration with critic oversight: permission policy, denial accounting, oversight cadence triggers (v2 preserves v1 fields so existing configs load unchanged)."),
|
|
1961
|
+
pr_feedback_loop: PrFeedbackLoopConfigSchema.optional().describe("Autonomous PR babysitting settling loop (issue #2502) \u2014 triple opt-in with pr_monitor.enabled + pr_monitor.auto_pr_feedback; off by default; publication profile is none-only."),
|
|
1952
1962
|
pr_monitor: PrMonitorConfigSchema.optional().describe("GitHub PR subscription and polling (FR-001) \u2014 disabled by default; opt-in for real-time PR status updates."),
|
|
1953
1963
|
external_skills: ExternalSkillsConfigSchema.optional().describe("External skills: candidate model, discovery, and quarantine store (FR-001) \u2014 all subsystems opt-in."),
|
|
1954
1964
|
skills: SkillsConfigSchema.optional().describe("Opt-in gate for the 7 skill_* management tools (FR-004). Default false: the tools are host-denied for every agent except skill_improver (genuinely unreachable, not merely unlisted \u2014 issue #2528)."),
|
|
@@ -1957,4 +1967,4 @@ var init_schema = __esm(() => {
|
|
|
1957
1967
|
});
|
|
1958
1968
|
});
|
|
1959
1969
|
|
|
1960
|
-
export { init_package, package_default, DEFAULT_MODEL_CONTEXT_TOKENS, init_context_window, _internals, isKnownCanonicalRole, getCanonicalAgentRole, resolveGeneratedAgentRole, stripKnownSwarmPrefix, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_SECTION_SCHEMAS, GateConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GATE_CONFIG_READERS, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, RetentionConfigSchema, ReviewPassesConfigSchema, AUTO_REVIEW_V8_BURN_IN_DECISION, AutoReviewConfigSchema, resolveAutoReviewConfig, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, GitConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, resolveGuardrailsConfig, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, KnowledgeConfigSchema, LearningConfigSchema, ConsensusConfigSchema, OtlpExportConfigSchema, ObservabilityConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, HarnessEvolutionConfigSchema, DEFAULT_HARNESS_EVOLUTION_CONFIG, SkillImproverConfigSchema, SkillsConfigSchema, SkillOptConfigSchema, DEFAULT_SKILL_OPT_CONFIG, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, resolveExternalSkillsConfig, DEFAULT_PR_REVIEW_RESILIENCE_CONFIG, PrReviewResilienceConfigSchema, ReviewRoutingConfigSchema, DEFAULT_REVIEW_ROUTING_CONFIG, LaneLivenessWatchdogConfigSchema, DispatchProtectionConfigSchema, DashboardConfigSchema, DEFAULT_PR_REVIEW_LEGACY_TRANSCRIPT_COMPATIBILITY, PluginConfigSchema, init_schema };
|
|
1970
|
+
export { init_package, package_default, DEFAULT_MODEL_CONTEXT_TOKENS, init_context_window, _internals, isKnownCanonicalRole, getCanonicalAgentRole, resolveGeneratedAgentRole, stripKnownSwarmPrefix, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_SECTION_SCHEMAS, GateConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GATE_CONFIG_READERS, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, RetentionConfigSchema, ReviewPassesConfigSchema, AUTO_REVIEW_V8_BURN_IN_DECISION, AutoReviewConfigSchema, resolveAutoReviewConfig, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, GitConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, resolveGuardrailsConfig, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, KnowledgeConfigSchema, LearningConfigSchema, ConsensusConfigSchema, OtlpExportConfigSchema, ObservabilityConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, HarnessEvolutionConfigSchema, DEFAULT_HARNESS_EVOLUTION_CONFIG, SkillImproverConfigSchema, SkillsConfigSchema, SkillOptConfigSchema, DEFAULT_SKILL_OPT_CONFIG, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, PrFeedbackLoopConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, resolveExternalSkillsConfig, DEFAULT_PR_REVIEW_RESILIENCE_CONFIG, PrReviewResilienceConfigSchema, ReviewRoutingConfigSchema, DEFAULT_REVIEW_ROUTING_CONFIG, LaneLivenessWatchdogConfigSchema, DispatchProtectionConfigSchema, DashboardConfigSchema, DEFAULT_PR_REVIEW_LEGACY_TRANSCRIPT_COMPATIBILITY, PluginConfigSchema, init_schema };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
observeStoreHealth
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-516j9vsk.js";
|
|
5
5
|
import {
|
|
6
6
|
telemetry
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-6mwha20t.js";
|
|
8
8
|
import {
|
|
9
9
|
init_schema,
|
|
10
10
|
stripKnownSwarmPrefix
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-rp4akjrm.js";
|
|
12
12
|
import {
|
|
13
13
|
init_constants
|
|
14
14
|
} from "./index-w872yykk.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
validateSwarmPath
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-gc6h1fmf.js";
|
|
5
5
|
import {
|
|
6
6
|
bunWrite
|
|
7
7
|
} from "./index-2s7dvzff.js";
|
|
@@ -18,21 +18,21 @@ import {
|
|
|
18
18
|
releaseCoordinationLease,
|
|
19
19
|
transitionCoordinationState,
|
|
20
20
|
withCoordinationTransaction
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-vmthakz0.js";
|
|
22
22
|
import {
|
|
23
23
|
getProjectDb,
|
|
24
24
|
projectDbExists
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-bv4b8tpa.js";
|
|
26
26
|
import {
|
|
27
27
|
observeDelegationLedgerPressure
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-516j9vsk.js";
|
|
29
29
|
import {
|
|
30
30
|
EvidenceLockTimeoutError,
|
|
31
31
|
withEvidenceLock
|
|
32
|
-
} from "./index-
|
|
32
|
+
} from "./index-ea9fk6v0.js";
|
|
33
33
|
import {
|
|
34
34
|
telemetry
|
|
35
|
-
} from "./index-
|
|
35
|
+
} from "./index-6mwha20t.js";
|
|
36
36
|
import {
|
|
37
37
|
canonicalRootKeyFresh,
|
|
38
38
|
sameProjectRoot
|
|
@@ -4660,7 +4660,7 @@ async function reconcileLegacyCoderSettlements(directory, maxRecords, onReconcil
|
|
|
4660
4660
|
const candidates = readDelegations(directory).filter((record) => record.normalizedAgent === "coder" && Boolean(record.legacyCoderSettlementTransfer) && Boolean(record.terminalResult)).slice(0, maxRecords);
|
|
4661
4661
|
if (candidates.length === 0)
|
|
4662
4662
|
return 0;
|
|
4663
|
-
const { transferCoderSettlementToBackground } = await import("./coder-settlement-
|
|
4663
|
+
const { transferCoderSettlementToBackground } = await import("./coder-settlement-b57917a3.js");
|
|
4664
4664
|
let transferred = 0;
|
|
4665
4665
|
for (const record of candidates) {
|
|
4666
4666
|
try {
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
tryAcquireLock
|
|
4
|
+
} from "./index-ejhxgyvm.js";
|
|
5
|
+
import {
|
|
6
|
+
atomicWriteFileAnyRoot,
|
|
7
|
+
atomicWriteSwarmFileSync
|
|
8
|
+
} from "./index-989v83pb.js";
|
|
9
|
+
import {
|
|
10
|
+
init_loader,
|
|
11
|
+
loadPluginConfig
|
|
12
|
+
} from "./index-xj5z92qz.js";
|
|
13
|
+
import {
|
|
14
|
+
init_logger,
|
|
15
|
+
log,
|
|
16
|
+
warn
|
|
17
|
+
} from "./index-zgwm4ryv.js";
|
|
18
|
+
|
|
19
|
+
// src/sdd/speckit-checkoff.ts
|
|
20
|
+
init_loader();
|
|
21
|
+
import { createHash } from "crypto";
|
|
22
|
+
import * as fs from "fs";
|
|
23
|
+
import * as path from "path";
|
|
24
|
+
init_logger();
|
|
25
|
+
var SPECKIT_CHECKOFF_LEDGER_REL = path.join(".swarm", "speckit-checkoff-ledger.json");
|
|
26
|
+
var TASK_LINE_REGEX = /^\s*-\s+\[[ xX]\]\s+(T\d+)/;
|
|
27
|
+
var FR_REF_REGEX = /(?:[A-Za-z0-9][A-Za-z0-9._-]*\/)?FR-\d{3}/g;
|
|
28
|
+
var MAX_TASKS_FILE_BYTES = 512 * 1024;
|
|
29
|
+
var FR_BARE_SUFFIX = /FR-\d{3}$/;
|
|
30
|
+
function refsMatch(a, b) {
|
|
31
|
+
if (a === b)
|
|
32
|
+
return true;
|
|
33
|
+
const aBare = !a.includes("/");
|
|
34
|
+
const bBare = !b.includes("/");
|
|
35
|
+
if (aBare && !bBare && FR_BARE_SUFFIX.test(b) && b.endsWith(`/${a}`))
|
|
36
|
+
return true;
|
|
37
|
+
if (bBare && !aBare && FR_BARE_SUFFIX.test(a) && a.endsWith(`/${b}`))
|
|
38
|
+
return true;
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
function sha256(text) {
|
|
42
|
+
return createHash("sha256").update(text, "utf-8").digest("hex");
|
|
43
|
+
}
|
|
44
|
+
function readBounded(filePath) {
|
|
45
|
+
try {
|
|
46
|
+
const stat = fs.lstatSync(filePath);
|
|
47
|
+
if (!stat.isFile() || stat.size > MAX_TASKS_FILE_BYTES)
|
|
48
|
+
return null;
|
|
49
|
+
return fs.readFileSync(filePath, "utf-8");
|
|
50
|
+
} catch {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function parseSpeckitTasksContent(content, namespaced, featureId) {
|
|
55
|
+
const tasks = [];
|
|
56
|
+
const taskLines = [];
|
|
57
|
+
for (const rawLine of content.replace(/\r\n/g, `
|
|
58
|
+
`).split(`
|
|
59
|
+
`)) {
|
|
60
|
+
const match = rawLine.match(TASK_LINE_REGEX);
|
|
61
|
+
if (!match)
|
|
62
|
+
continue;
|
|
63
|
+
const snapshot = rawLine.trim();
|
|
64
|
+
taskLines.push(snapshot.replace(/\[[xX]\]/g, "[ ]"));
|
|
65
|
+
const refs = [...snapshot.matchAll(FR_REF_REGEX)].map((m) => m[0]);
|
|
66
|
+
const frRefs = refs.map((ref) => namespaced && !ref.includes("/") ? `${featureId}/${ref}` : ref);
|
|
67
|
+
tasks.push({
|
|
68
|
+
taskId: match[1],
|
|
69
|
+
frRefs,
|
|
70
|
+
lineSnapshot: snapshot,
|
|
71
|
+
initiallyChecked: /\[x\]/i.test(snapshot)
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return { tasks, taskLinesDigest: sha256(taskLines.join(`
|
|
75
|
+
`)) };
|
|
76
|
+
}
|
|
77
|
+
function writeSpeckitCheckoffLedger(root, resolution) {
|
|
78
|
+
const features = [];
|
|
79
|
+
resolution.features.forEach((featureId, index) => {
|
|
80
|
+
const specRel = resolution.spec.sourcePaths[index] ?? `specs/${featureId}/spec.md`;
|
|
81
|
+
const tasksRelPath = `${path.dirname(specRel).split(path.sep).join("/")}/tasks.md`;
|
|
82
|
+
const content = readBounded(path.join(root, tasksRelPath));
|
|
83
|
+
if (content === null)
|
|
84
|
+
return;
|
|
85
|
+
const parsed = parseSpeckitTasksContent(content, resolution.namespaced, featureId);
|
|
86
|
+
if (parsed.tasks.length === 0)
|
|
87
|
+
return;
|
|
88
|
+
const requirementIds = resolution.featureRequirementIds[index] ?? [];
|
|
89
|
+
for (const task of parsed.tasks) {
|
|
90
|
+
const refs = new Set(task.frRefs);
|
|
91
|
+
for (const storyMatch of task.lineSnapshot.matchAll(/\[US(\d+)\]/gi)) {
|
|
92
|
+
const storyIndex = Number(storyMatch[1]) - 1;
|
|
93
|
+
const mapped = requirementIds[storyIndex];
|
|
94
|
+
if (mapped)
|
|
95
|
+
refs.add(mapped);
|
|
96
|
+
}
|
|
97
|
+
task.frRefs = [...refs];
|
|
98
|
+
}
|
|
99
|
+
features.push({
|
|
100
|
+
featureId,
|
|
101
|
+
tasksRelPath,
|
|
102
|
+
taskLinesDigest: parsed.taskLinesDigest,
|
|
103
|
+
tasks: parsed.tasks
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
const ledger = {
|
|
107
|
+
version: 1,
|
|
108
|
+
namespaced: resolution.namespaced,
|
|
109
|
+
projectedAt: new Date().toISOString(),
|
|
110
|
+
features
|
|
111
|
+
};
|
|
112
|
+
atomicWriteSwarmFileSync(path.join(root, SPECKIT_CHECKOFF_LEDGER_REL), `${JSON.stringify(ledger, null, 2)}
|
|
113
|
+
`);
|
|
114
|
+
}
|
|
115
|
+
function readLedger(root) {
|
|
116
|
+
const raw = readBounded(path.join(root, SPECKIT_CHECKOFF_LEDGER_REL));
|
|
117
|
+
if (raw === null)
|
|
118
|
+
return null;
|
|
119
|
+
try {
|
|
120
|
+
const parsed = JSON.parse(raw);
|
|
121
|
+
if (parsed?.version !== 1 || !Array.isArray(parsed.features))
|
|
122
|
+
return null;
|
|
123
|
+
return parsed;
|
|
124
|
+
} catch {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function writeLedger(root, ledger) {
|
|
129
|
+
atomicWriteSwarmFileSync(path.join(root, SPECKIT_CHECKOFF_LEDGER_REL), `${JSON.stringify(ledger, null, 2)}
|
|
130
|
+
`);
|
|
131
|
+
}
|
|
132
|
+
function normalizeCheckboxState(line) {
|
|
133
|
+
return line.replace(/\[[xX]\]/g, "[ ]");
|
|
134
|
+
}
|
|
135
|
+
function applyCheckoffEdit(taskEntry, _baselineContent, currentContent) {
|
|
136
|
+
const lines = currentContent.split(/(?=\r?\n)/);
|
|
137
|
+
for (let i = 0;i < lines.length; i++) {
|
|
138
|
+
const line = lines[i];
|
|
139
|
+
const lineTrimmed = line.trim();
|
|
140
|
+
if (normalizeCheckboxState(lineTrimmed) !== normalizeCheckboxState(taskEntry.lineSnapshot)) {
|
|
141
|
+
const idMatch = line.match(TASK_LINE_REGEX);
|
|
142
|
+
if (idMatch && idMatch[1] === taskEntry.taskId) {
|
|
143
|
+
return {
|
|
144
|
+
applied: false,
|
|
145
|
+
content: currentContent,
|
|
146
|
+
reason: "task-line-changed"
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
if (/\[x\]/i.test(lineTrimmed)) {
|
|
152
|
+
return {
|
|
153
|
+
applied: false,
|
|
154
|
+
content: currentContent,
|
|
155
|
+
reason: "already-checked"
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
const boxIndex = line.indexOf("[ ]");
|
|
159
|
+
if (boxIndex === -1) {
|
|
160
|
+
return {
|
|
161
|
+
applied: false,
|
|
162
|
+
content: currentContent,
|
|
163
|
+
reason: "task-line-changed"
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
lines[i] = `${line.slice(0, boxIndex)}[x]${line.slice(boxIndex + 3)}`;
|
|
167
|
+
return { applied: true, content: lines.join(""), reason: "ok" };
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
applied: false,
|
|
171
|
+
content: currentContent,
|
|
172
|
+
reason: "task-line-not-found"
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function extractFrRefsFromText(text) {
|
|
176
|
+
return [...text.matchAll(FR_REF_REGEX)].map((m) => m[0]);
|
|
177
|
+
}
|
|
178
|
+
async function propagateSpeckitCheckoff(directory, completed, options) {
|
|
179
|
+
if (!options.enabled) {
|
|
180
|
+
return { ran: false, reason: "disabled", features: [] };
|
|
181
|
+
}
|
|
182
|
+
const root = path.resolve(directory);
|
|
183
|
+
const ledger = readLedger(root);
|
|
184
|
+
if (!ledger) {
|
|
185
|
+
return { ran: false, reason: "no-ledger", features: [] };
|
|
186
|
+
}
|
|
187
|
+
const completedRefs = [
|
|
188
|
+
...completed.frRefs,
|
|
189
|
+
...extractFrRefsFromText(`${completed.text ?? ""}`)
|
|
190
|
+
];
|
|
191
|
+
const results = [];
|
|
192
|
+
let anyMatch = false;
|
|
193
|
+
let ledgerDirty = false;
|
|
194
|
+
const checkedAt = new Date().toISOString();
|
|
195
|
+
for (const feature of ledger.features) {
|
|
196
|
+
const result = {
|
|
197
|
+
featureId: feature.featureId,
|
|
198
|
+
tasksRelPath: feature.tasksRelPath,
|
|
199
|
+
checked: [],
|
|
200
|
+
reopenedSkipped: [],
|
|
201
|
+
stale: false,
|
|
202
|
+
refused: []
|
|
203
|
+
};
|
|
204
|
+
const matchedTasks = feature.tasks.filter((task) => task.frRefs.some((taskRef) => completedRefs.some((completedRef) => refsMatch(completedRef, taskRef))));
|
|
205
|
+
const hasSwarmChecked = feature.tasks.some((t) => t.swarmCheckedAt);
|
|
206
|
+
if (matchedTasks.length === 0 && !hasSwarmChecked) {
|
|
207
|
+
results.push(result);
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
if (matchedTasks.length > 0)
|
|
211
|
+
anyMatch = true;
|
|
212
|
+
const tasksAbs = path.join(root, feature.tasksRelPath);
|
|
213
|
+
let current = readBounded(tasksAbs);
|
|
214
|
+
if (current === null) {
|
|
215
|
+
result.stale = true;
|
|
216
|
+
result.refused.push(...matchedTasks.map((t) => t.taskId));
|
|
217
|
+
results.push(result);
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
const currentDigest = parseSpeckitTasksContent(current, ledger.namespaced, feature.featureId).taskLinesDigest;
|
|
221
|
+
if (currentDigest !== feature.taskLinesDigest) {
|
|
222
|
+
result.stale = true;
|
|
223
|
+
result.refused.push(...matchedTasks.map((t) => t.taskId));
|
|
224
|
+
results.push(result);
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
for (const task of feature.tasks) {
|
|
228
|
+
if (!task.swarmCheckedAt)
|
|
229
|
+
continue;
|
|
230
|
+
const line = current.replace(/\r\n/g, `
|
|
231
|
+
`).split(`
|
|
232
|
+
`).find((l) => normalizeCheckboxState(l.trim()) === normalizeCheckboxState(task.lineSnapshot));
|
|
233
|
+
if (line !== undefined && /\[ \]/.test(line)) {
|
|
234
|
+
result.reopenedSkipped.push(task.taskId);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
let contentChanged = false;
|
|
238
|
+
for (const task of matchedTasks) {
|
|
239
|
+
if (task.swarmCheckedAt && result.reopenedSkipped.includes(task.taskId)) {
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
const outcome = applyCheckoffEdit(task, current, current);
|
|
243
|
+
if (outcome.applied) {
|
|
244
|
+
current = outcome.content;
|
|
245
|
+
contentChanged = true;
|
|
246
|
+
task.swarmCheckedAt = checkedAt;
|
|
247
|
+
ledgerDirty = true;
|
|
248
|
+
result.checked.push(task.taskId);
|
|
249
|
+
} else if (outcome.reason === "already-checked") {
|
|
250
|
+
if (!task.swarmCheckedAt) {
|
|
251
|
+
task.swarmCheckedAt = checkedAt;
|
|
252
|
+
ledgerDirty = true;
|
|
253
|
+
}
|
|
254
|
+
} else {
|
|
255
|
+
result.refused.push(task.taskId);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
if (contentChanged && current !== null) {
|
|
259
|
+
const lock = await tryAcquireLock(root, feature.tasksRelPath, "speckit-checkoff", completed.taskId);
|
|
260
|
+
if (!lock.acquired) {
|
|
261
|
+
result.refused.push(...result.checked);
|
|
262
|
+
result.checked = [];
|
|
263
|
+
results.push(result);
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
try {
|
|
267
|
+
const latest = readBounded(tasksAbs);
|
|
268
|
+
if (latest === null || latest !== current) {
|
|
269
|
+
if (latest !== null) {
|
|
270
|
+
let reconciled = latest;
|
|
271
|
+
let ok = true;
|
|
272
|
+
for (const taskId of [...result.checked]) {
|
|
273
|
+
const task = feature.tasks.find((t) => t.taskId === taskId);
|
|
274
|
+
const outcome = applyCheckoffEdit(task, latest, reconciled);
|
|
275
|
+
if (outcome.applied) {
|
|
276
|
+
reconciled = outcome.content;
|
|
277
|
+
} else if (outcome.reason !== "already-checked") {
|
|
278
|
+
ok = false;
|
|
279
|
+
result.checked = result.checked.filter((id) => id !== taskId);
|
|
280
|
+
result.refused.push(taskId);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
if (ok && result.checked.length > 0) {
|
|
284
|
+
await atomicWriteFileAnyRoot(tasksAbs, reconciled);
|
|
285
|
+
current = reconciled;
|
|
286
|
+
} else {
|
|
287
|
+
current = latest;
|
|
288
|
+
}
|
|
289
|
+
} else {
|
|
290
|
+
result.refused.push(...result.checked);
|
|
291
|
+
result.checked = [];
|
|
292
|
+
}
|
|
293
|
+
} else {
|
|
294
|
+
await atomicWriteFileAnyRoot(tasksAbs, current);
|
|
295
|
+
}
|
|
296
|
+
} finally {
|
|
297
|
+
if (lock.lock._release) {
|
|
298
|
+
await lock.lock._release().catch(() => {});
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
results.push(result);
|
|
303
|
+
}
|
|
304
|
+
if (ledgerDirty) {
|
|
305
|
+
try {
|
|
306
|
+
writeLedger(root, ledger);
|
|
307
|
+
} catch (err) {
|
|
308
|
+
warn(`[speckit-checkoff] ledger update failed after check-off: ${err instanceof Error ? err.message : String(err)}`);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return {
|
|
312
|
+
ran: true,
|
|
313
|
+
features: results,
|
|
314
|
+
unmatched: !anyMatch || undefined
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
async function maybePropagateSpeckitCheckoff(directory, completed) {
|
|
318
|
+
try {
|
|
319
|
+
const config = loadPluginConfig(directory);
|
|
320
|
+
if (config?.speckit_checkoff?.enabled !== true)
|
|
321
|
+
return;
|
|
322
|
+
const result = await propagateSpeckitCheckoff(directory, completed, {
|
|
323
|
+
enabled: true
|
|
324
|
+
});
|
|
325
|
+
if (result.ran && result.features.some((f) => f.checked.length > 0)) {
|
|
326
|
+
log(`[speckit-checkoff] task ${completed.taskId} checked off: ${result.features.map((f) => `${f.featureId}:[${f.checked.join(", ")}]`).join(" ")}`);
|
|
327
|
+
}
|
|
328
|
+
} catch (err) {
|
|
329
|
+
warn(`[speckit-checkoff] propagation for ${completed.taskId} failed (non-fatal): ${err instanceof Error ? err.message : String(err)}`);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
var _internals = {
|
|
333
|
+
applyCheckoffEdit,
|
|
334
|
+
parseSpeckitTasksContent,
|
|
335
|
+
readBounded,
|
|
336
|
+
sha256
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
export { SPECKIT_CHECKOFF_LEDGER_REL, parseSpeckitTasksContent, writeSpeckitCheckoffLedger, applyCheckoffEdit, propagateSpeckitCheckoff, maybePropagateSpeckitCheckoff, _internals };
|
|
@@ -2,32 +2,34 @@
|
|
|
2
2
|
import {
|
|
3
3
|
derivePlanId,
|
|
4
4
|
derivePlanIdentityHash
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-vmthakz0.js";
|
|
6
6
|
import {
|
|
7
7
|
getProjectDb,
|
|
8
8
|
projectDbExists,
|
|
9
9
|
withImmediateTransaction,
|
|
10
10
|
withProjectDbReadOnly
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-bv4b8tpa.js";
|
|
12
12
|
import {
|
|
13
13
|
assertProjectRoot,
|
|
14
14
|
withEvidenceLock
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-ea9fk6v0.js";
|
|
16
16
|
import {
|
|
17
17
|
emit
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-6mwha20t.js";
|
|
19
19
|
import {
|
|
20
20
|
ExecutionProfileSchema,
|
|
21
21
|
PlanSchema,
|
|
22
22
|
TaskStatusSchema,
|
|
23
|
-
init_loader,
|
|
24
|
-
loadPluginConfig,
|
|
25
23
|
normalizeCurrentPhaseInPlace
|
|
26
|
-
} from "./index-
|
|
24
|
+
} from "./index-gx2vp8gx.js";
|
|
25
|
+
import {
|
|
26
|
+
init_loader,
|
|
27
|
+
loadPluginConfig
|
|
28
|
+
} from "./index-xj5z92qz.js";
|
|
27
29
|
import {
|
|
28
30
|
init_package,
|
|
29
31
|
package_default
|
|
30
|
-
} from "./index-
|
|
32
|
+
} from "./index-rp4akjrm.js";
|
|
31
33
|
import {
|
|
32
34
|
criticalWarn,
|
|
33
35
|
init_logger,
|