devflow-kit 3.0.0 → 3.1.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/CHANGELOG.md +22 -0
- package/dist/agents/git.md +2 -2
- package/dist/cli/agents-view/index.js +1 -1
- package/dist/cli/agents-view/render.js +2 -2
- package/dist/cli/agents-view/state.js +2 -2
- package/dist/cli/agents-view/terminal.js +5 -5
- package/dist/cli/commands/agents.js +7 -6
- package/dist/cli/commands/ambient.js +1 -1
- package/dist/cli/commands/attribution-prompts.js +8 -8
- package/dist/cli/commands/capture.js +1 -1
- package/dist/cli/commands/compliance-prompts.js +8 -8
- package/dist/cli/commands/compliance.js +8 -7
- package/dist/cli/commands/flags.js +33 -31
- package/dist/cli/commands/hud.js +1 -1
- package/dist/cli/commands/init-seed.js +9 -9
- package/dist/cli/commands/init.js +34 -32
- package/dist/cli/commands/install-report.js +10 -10
- package/dist/cli/commands/learning.js +267 -129
- package/dist/cli/commands/memory.js +1 -1
- package/dist/cli/commands/proxy.js +23 -23
- package/dist/cli/commands/rules.js +6 -5
- package/dist/cli/commands/tracker-prompts.js +6 -6
- package/dist/cli/commands/tracker.js +9 -9
- package/dist/cli/commands/uninstall.js +20 -20
- package/dist/cli/flags-view/render.js +5 -5
- package/dist/cli/flags-view/state.js +9 -9
- package/dist/cli/flags-view/terminal.js +4 -4
- package/dist/cli/tui/cells.js +1 -1
- package/dist/cli/tui/terminal.js +6 -6
- package/dist/commands/dynamic-build.md +18 -4
- package/dist/commands/dynamic-plan.md +19 -5
- package/dist/commands/dynamic-profile.md +17 -3
- package/dist/commands/dynamic-tickets.md +18 -4
- package/dist/commands/release.md +15 -1
- package/dist/commands/research.md +1 -1
- package/dist/commands/resolve.md +8 -9
- package/dist/core/agent-frontmatter.js +3 -3
- package/dist/core/agent-models.js +6 -6
- package/dist/core/agent-state.js +2 -2
- package/dist/core/ansi.js +2 -2
- package/dist/core/cache.js +7 -8
- package/dist/core/codex-auth-inspect.js +4 -4
- package/dist/core/compliance-compose.js +3 -3
- package/dist/core/compliance.js +3 -4
- package/dist/core/evidence-policy.js +14 -13
- package/dist/core/external-models.js +1 -1
- package/dist/core/feature-config.js +3 -3
- package/dist/core/feature-switch.js +3 -3
- package/dist/core/flags.js +25 -25
- package/dist/core/fs-atomic.js +6 -7
- package/dist/core/learning-queue-cleanup.js +16 -80
- package/dist/core/learning-store.js +61 -0
- package/dist/core/manifest.js +5 -5
- package/dist/core/mds-variants.js +13 -13
- package/dist/core/model-discovery.js +8 -8
- package/dist/core/observations.js +17 -101
- package/dist/core/orphan-sweep.js +4 -4
- package/dist/core/plugins.js +4 -5
- package/dist/core/project-paths.js +9 -13
- package/dist/core/proxy-log.js +8 -8
- package/dist/core/proxy-state.js +3 -3
- package/dist/core/reference-sweep.js +6 -6
- package/dist/core/teammate-mode-cleanup.js +1 -1
- package/dist/core/tracker.js +14 -14
- package/dist/hud/colors.js +2 -2
- package/dist/hud/components/learning-counts.js +2 -16
- package/dist/hud/components/version-badge.js +1 -1
- package/dist/skills/git/references/pr/resolve-review-threads.md +2 -2
- package/dist/targets/claude-code/compliance-install.js +17 -15
- package/dist/targets/claude-code/hooks.js +2 -2
- package/dist/targets/claude-code/installer.js +24 -24
- package/dist/targets/claude-code/legacy.js +1 -1
- package/dist/targets/claude-code/post-install.js +25 -11
- package/dist/targets/claude-code/tracker-install.js +2 -2
- package/package.json +1 -1
- package/src/assets/agents/code.md +1 -4
- package/src/assets/agents/design.md +2 -2
- package/src/assets/agents/diagnose.md +1 -1
- package/src/assets/agents/git.mds +2 -2
- package/src/assets/agents/knowledge.md +3 -3
- package/src/assets/agents/learning.md +281 -196
- package/src/assets/agents/research.md +1 -1
- package/src/assets/agents/review.md +3 -3
- package/src/assets/agents/scrutinize.md +1 -1
- package/src/assets/agents/skim.md +1 -1
- package/src/assets/agents/triage.md +9 -9
- package/src/assets/commands/_partials/_decisions.mds +8 -3
- package/src/assets/commands/_partials/_docs_root.mds +3 -3
- package/src/assets/commands/_partials/_engine.mds +1 -1
- package/src/assets/commands/_partials/_preamble.mds +6 -2
- package/src/assets/commands/_partials/_settings.mds +2 -2
- package/src/assets/commands/dynamic-build.mds +1 -1
- package/src/assets/commands/dynamic-plan.mds +3 -3
- package/src/assets/commands/dynamic-profile.mds +1 -1
- package/src/assets/commands/dynamic-tickets.mds +2 -2
- package/src/assets/commands/release.md +15 -1
- package/src/assets/commands/research.mds +1 -1
- package/src/assets/commands/resolve.mds +8 -9
- package/src/assets/mds/git/_pr.mds +3 -3
- package/src/assets/mds/tracker/_common.mds +1 -1
- package/src/assets/mds/tracker/_github.mds +1 -1
- package/src/assets/mds/tracker/_jira.mds +1 -1
- package/src/assets/mds/tracker/_linear.mds +1 -1
- package/src/assets/mds/tracker/_mcp.mds +6 -5
- package/src/assets/scripts/hooks/assets/orchestrator-charter.md +1 -0
- package/src/assets/scripts/hooks/background-memory-update +28 -22
- package/src/assets/scripts/hooks/capture-turn +1 -17
- package/src/assets/scripts/hooks/ensure-devflow-init +1 -1
- package/src/assets/scripts/hooks/ensure-proxy +5 -6
- package/src/assets/scripts/hooks/ensure-root-gitignore +1 -1
- package/src/assets/scripts/hooks/is-hex-sha +1 -1
- package/src/assets/scripts/hooks/json-helper.cjs +348 -814
- package/src/assets/scripts/hooks/json-parse +3 -2
- package/src/assets/scripts/hooks/lib/decisions-format.cjs +205 -156
- package/src/assets/scripts/hooks/lib/learning-store.cjs +3102 -0
- package/src/assets/scripts/hooks/lib/mkdir-lock.cjs +7 -5
- package/src/assets/scripts/hooks/lib/project-paths.cjs +13 -19
- package/src/assets/scripts/hooks/lib/render-decisions.cjs +253 -226
- package/src/assets/scripts/hooks/queue-append +2 -2
- package/src/assets/scripts/hooks/resolve-project-root +3 -4
- package/src/assets/scripts/hooks/session-start-context +40 -18
- package/src/assets/scripts/lib/project-config.cjs +2 -2
- package/src/assets/scripts/pr-evidence.cjs +3 -3
- package/src/assets/scripts/redact-secrets.cjs +20 -20
- package/src/assets/scripts/release-trace.cjs +1 -1
- package/src/assets/scripts/resolve-evidence-policy.cjs +3 -3
- package/src/assets/scripts/resolve-settings.cjs +3 -3
- package/src/assets/scripts/verify-evidence.cjs +2 -2
- package/src/assets/skills/apply-decisions/SKILL.md +37 -17
- package/src/assets/skills/docs-framework/SKILL.md +2 -2
- package/src/assets/skills/feature-knowledge/SKILL.md +6 -5
- package/src/targets/claude-code/templates/managed-settings.json +3 -3
- package/dist/core/observation-io.js +0 -50
- package/src/assets/scripts/hooks/decisions-usage-scan.cjs +0 -131
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// src/assets/scripts/hooks/lib/mkdir-lock.cjs
|
|
2
2
|
//
|
|
3
|
-
// Shared mkdir-based locking helpers used by
|
|
4
|
-
//
|
|
3
|
+
// Shared mkdir-based locking helpers used by learning-store.cjs — whose
|
|
4
|
+
// withDecisionsLock every learning op that writes and the render CLI take, and
|
|
5
|
+
// whose queue claim also takes the queue's own lock — and any other CJS hook that
|
|
6
|
+
// needs exclusive access to a shared resource.
|
|
5
7
|
//
|
|
6
8
|
// DESIGN: mkdir is atomic on POSIX — the kernel guarantees that only one caller
|
|
7
9
|
// succeeds on a given path. On EEXIST we check staleness (mtime > staleMs) and
|
|
@@ -44,12 +46,12 @@ function _idleSleep50() {
|
|
|
44
46
|
/**
|
|
45
47
|
* Acquire a mkdir-based lock. Returns true on success, false on timeout.
|
|
46
48
|
*
|
|
47
|
-
* Stale-break window
|
|
49
|
+
* Stale-break window: a lock directory older than `staleMs`
|
|
48
50
|
* (default 60 s) is forcibly removed and the caller retries. This protects against
|
|
49
51
|
* crashed holders but creates a narrow TOCTOU window: if a holder is actively
|
|
50
52
|
* working and takes longer than 60 s, its lock can be stolen — leading to concurrent
|
|
51
|
-
* ledger writes. Current callers (
|
|
52
|
-
* only synchronous file I/O + JSON parse and complete well under 60 s in practice,
|
|
53
|
+
* ledger writes. Current callers (the learning ops through withDecisionsLock, and the
|
|
54
|
+
* render CLI) perform only synchronous file I/O + JSON parse and complete well under 60 s in practice,
|
|
53
55
|
* so this window is not reachable under normal operation. For long-running callers
|
|
54
56
|
* call refreshLock(lockDir) periodically to reset the mtime and push the deadline
|
|
55
57
|
* out by another staleMs interval.
|
|
@@ -57,11 +57,16 @@ function getLearningPendingTurnsPath(projectRoot) {
|
|
|
57
57
|
return path.join(projectRoot, '.devflow', 'learning', '.pending-turns.jsonl');
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
/** .devflow/learning/.pending-turns.processing —
|
|
60
|
+
/** .devflow/learning/.pending-turns.processing — the claimed batch a Learning run holds while it processes it */
|
|
61
61
|
function getLearningPendingTurnsProcessingPath(projectRoot) {
|
|
62
62
|
return path.join(projectRoot, '.devflow', 'learning', '.pending-turns.processing');
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
/** .devflow/learning/.pending-turns.owner — the token of the run that holds the claim (learning-store.cjs) */
|
|
66
|
+
function getLearningClaimOwnerPath(projectRoot) {
|
|
67
|
+
return path.join(projectRoot, '.devflow', 'learning', '.pending-turns.owner');
|
|
68
|
+
}
|
|
69
|
+
|
|
65
70
|
// ---------------------------------------------------------------------------
|
|
66
71
|
// Learning content files
|
|
67
72
|
// ---------------------------------------------------------------------------
|
|
@@ -96,31 +101,21 @@ function getDecisionsArchivePath(projectRoot) {
|
|
|
96
101
|
return path.join(projectRoot, '.devflow', 'learning', 'decisions-log.archive.jsonl');
|
|
97
102
|
}
|
|
98
103
|
|
|
104
|
+
/** .devflow/learning/decisions-history.jsonl — prior content versions of rewritten entries (learning-store.cjs) */
|
|
105
|
+
function getDecisionsHistoryPath(projectRoot) {
|
|
106
|
+
return path.join(projectRoot, '.devflow', 'learning', 'decisions-history.jsonl');
|
|
107
|
+
}
|
|
108
|
+
|
|
99
109
|
/** .devflow/learning/.decisions.lock — mkdir-based lock directory */
|
|
100
110
|
function getDecisionsLockDir(projectRoot) {
|
|
101
111
|
return path.join(projectRoot, '.devflow', 'learning', '.decisions.lock');
|
|
102
112
|
}
|
|
103
113
|
|
|
104
|
-
/** .devflow/learning/.decisions-usage.json */
|
|
105
|
-
function getDecisionsUsagePath(projectRoot) {
|
|
106
|
-
return path.join(projectRoot, '.devflow', 'learning', '.decisions-usage.json');
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/** .devflow/learning/.decisions-usage.lock/ — mkdir-based lock directory for usage file */
|
|
110
|
-
function getDecisionsUsageLockDir(projectRoot) {
|
|
111
|
-
return path.join(projectRoot, '.devflow', 'learning', '.decisions-usage.lock');
|
|
112
|
-
}
|
|
113
|
-
|
|
114
114
|
/** .devflow/learning/index.md — pre-rendered compact index written by render-decisions.cjs */
|
|
115
115
|
function getDecisionsIndexPath(projectRoot) {
|
|
116
116
|
return path.join(projectRoot, '.devflow', 'learning', 'index.md');
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
/** .devflow/learning/.observations.lock — mkdir-based lock directory for observation log writes */
|
|
120
|
-
function getObservationsLockDir(projectRoot) {
|
|
121
|
-
return path.join(projectRoot, '.devflow', 'learning', '.observations.lock');
|
|
122
|
-
}
|
|
123
|
-
|
|
124
119
|
// ---------------------------------------------------------------------------
|
|
125
120
|
// Memory / working-memory files
|
|
126
121
|
// ---------------------------------------------------------------------------
|
|
@@ -185,6 +180,7 @@ module.exports = {
|
|
|
185
180
|
// Learning queue files
|
|
186
181
|
getLearningPendingTurnsPath,
|
|
187
182
|
getLearningPendingTurnsProcessingPath,
|
|
183
|
+
getLearningClaimOwnerPath,
|
|
188
184
|
// Learning content files
|
|
189
185
|
getDecisionsFilePath,
|
|
190
186
|
getPitfallsFilePath,
|
|
@@ -192,10 +188,8 @@ module.exports = {
|
|
|
192
188
|
getDecisionsLedgerPath,
|
|
193
189
|
getDecisionsLogPath,
|
|
194
190
|
getDecisionsArchivePath,
|
|
191
|
+
getDecisionsHistoryPath,
|
|
195
192
|
getDecisionsLockDir,
|
|
196
|
-
getObservationsLockDir,
|
|
197
|
-
getDecisionsUsagePath,
|
|
198
|
-
getDecisionsUsageLockDir,
|
|
199
193
|
getDecisionsIndexPath,
|
|
200
194
|
// Memory files
|
|
201
195
|
getWorkingMemoryPath,
|