driftseal 0.1.0 → 0.2.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/README.md CHANGED
@@ -66,7 +66,7 @@ driftseal end \
66
66
 
67
67
  If the scope changes, close the current intent as `partial` or `abandoned`, then start a new one. After context loss, use `driftseal status` and `driftseal log --last 3` to re-anchor.
68
68
 
69
- If the user has authorized a Git commit, staging and committing only the verified changes and the just-closed intent log finalizes that round; it does not need a commit-only intent. Any content change made while preparing the commit starts a new round.
69
+ Single-step commands that only build, check, or record work already done — compiling, running tests, `git add`/`git commit` — need no intent of their own. When a commit is authorized, staging and committing only the verified changes and the just-closed intent log finalizes that round. Any content change made while preparing the commit starts a new round.
70
70
 
71
71
  ## Commands
72
72
 
package/README.zh-CN.md CHANGED
@@ -66,7 +66,7 @@ driftseal end \
66
66
 
67
67
  如果范围发生变化,先把当前 intent 以 `partial` 或 `abandoned` 关闭,再开启新的 intent。发生 context loss 后,用 `driftseal status` 和 `driftseal log --last 3` 重新锚定当前目标。
68
68
 
69
- 如果用户已经授权创建 Git commit,只把已验证的改动和刚关闭的 intent log 进行 stage 和 commit,就属于这一轮的持久化收尾,不需要额外开启一个只用于 commit 的 intent。准备 commit 时一旦需要修改内容,就必须开启新一轮。
69
+ 只负责构建、检查或记录已完成工作的单步命令(编译、跑测试、`git add`/`git commit`)不需要单独开启 intent。如果用户已经授权创建 Git commit,只把已验证的改动和刚关闭的 intent log 进行 stage 和 commit,就属于这一轮的持久化收尾。准备 commit 时一旦需要修改内容,就必须开启新一轮。
70
70
 
71
71
  ## 命令速览
72
72
 
package/bin/driftseal.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * Intent-level write-ahead log and MADR decision log for agentic coding sessions.
8
8
  *
9
9
  * Protocol per work round:
10
- * 1. driftseal begin "<intent>" [--verify "<how to verify>"] (before touching anything)
10
+ * 1. driftseal begin "<intent>" [--verify "<how to verify>"] (before changes that may need a rollback)
11
11
  * 2. execute the intent
12
12
  * 3. driftseal end [--status ...] [--note ...] [--verify-result ...] (reconcile against intent)
13
13
  *
@@ -35,7 +35,7 @@ const DECISION_STATUSES = [
35
35
  'superseded',
36
36
  ];
37
37
  const EVENT_SCHEMA_VERSION = 2;
38
- const PROTOCOL_VERSION = 4;
38
+ const PROTOCOL_VERSION = 5;
39
39
  const LOCK_STALE_MS = 30 * 60 * 1000;
40
40
  const LOCK_INIT_STALE_MS = 5 * 1000;
41
41
  const MAX_DECISION_SLUG_LENGTH = 180;
@@ -1018,9 +1018,12 @@ function intentProtocolBlock(version = PROTOCOL_VERSION) {
1018
1018
 
1019
1019
  This repo uses DriftSeal (\`driftseal\`) to prevent agent drift. Every work round:
1020
1020
 
1021
- 1. **Write intent first**, before modifying a file or running a mutating command:
1021
+ 1. **Write intent first**, before modifying, creating, or deleting files, or
1022
+ making any other change that may need a rollback:
1022
1023
  \`driftseal begin "<what this round will accomplish>" --verify "<command or check that proves it>"\`.
1023
1024
  Add one \`--decision <id>\` for each existing decision this round may change.
1025
+ Single-step commands that only build, check, or record work already done
1026
+ (compiling, running tests, \`git add\`/\`git commit\`) need no intent.
1024
1027
  2. **Execute only the intent.** Scope change? Close the current intent
1025
1028
  (\`driftseal end -s partial|abandoned -n "<why>"\`) and \`driftseal begin\` a new one.
1026
1029
  3. **Verify, then close**: run the declared verification, then
@@ -1044,7 +1047,19 @@ ${INTENT_PROTOCOL_END}`;
1044
1047
  }
1045
1048
 
1046
1049
  function previousIntentProtocolBlock(version) {
1047
- return intentProtocolBlock(version).replace(
1050
+ const v4 = intentProtocolBlock(version).replace(
1051
+ '1. **Write intent first**, before modifying, creating, or deleting files, or\n' +
1052
+ ' making any other change that may need a rollback:\n' +
1053
+ ' `driftseal begin "<what this round will accomplish>" --verify "<command or check that proves it>"`.\n' +
1054
+ ' Add one `--decision <id>` for each existing decision this round may change.\n' +
1055
+ ' Single-step commands that only build, check, or record work already done\n' +
1056
+ ' (compiling, running tests, `git add`/`git commit`) need no intent.',
1057
+ '1. **Write intent first**, before modifying a file or running a mutating command:\n' +
1058
+ ' `driftseal begin "<what this round will accomplish>" --verify "<command or check that proves it>"`.\n' +
1059
+ ' Add one `--decision <id>` for each existing decision this round may change.'
1060
+ );
1061
+ if (version >= 4) return v4;
1062
+ return v4.replace(
1048
1063
  ' by the next linked `decision update` or successful `end`. Closing as\n' +
1049
1064
  ' `failed` or `abandoned` cancels pending recovery for that intent.',
1050
1065
  ' by the next `decision update` or `end`.'
@@ -1489,6 +1504,7 @@ const commands = {
1489
1504
  knownManagedBlocks: [
1490
1505
  protocolEol(previousIntentProtocolBlock(2), eol),
1491
1506
  protocolEol(previousIntentProtocolBlock(3), eol),
1507
+ protocolEol(previousIntentProtocolBlock(4), eol),
1492
1508
  ],
1493
1509
  knownLegacyBlocks: [protocolEol(legacyIntentProtocolBlock(), eol)],
1494
1510
  });
@@ -1502,6 +1518,7 @@ const commands = {
1502
1518
  knownManagedBlocks: [
1503
1519
  protocolEol(decisionProtocolBlock(2), eol),
1504
1520
  protocolEol(decisionProtocolBlock(3), eol),
1521
+ protocolEol(decisionProtocolBlock(4), eol),
1505
1522
  ],
1506
1523
  knownLegacyBlocks: [protocolEol(legacyDecisionProtocolBlock(), eol)],
1507
1524
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "driftseal",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Seal intent, verification, and decisions into an auditable workflow for agentic coding",
5
5
  "keywords": [
6
6
  "driftseal",
@@ -35,8 +35,8 @@ open intent, stop mutating and coordinate instead of abandoning its work.
35
35
 
36
36
  ## Begin the Round
37
37
 
38
- Before modifying a file or running any mutating command, declare one objective
39
- and its proof:
38
+ Before modifying, creating, or deleting files — or making any other change that
39
+ may need a rollback — declare one objective and its proof:
40
40
 
41
41
  ```sh
42
42
  driftseal begin "<small objective for this round>" \
@@ -45,7 +45,9 @@ driftseal begin "<small objective for this round>" \
45
45
 
46
46
  Make the intent small enough to finish and verify in one round. Prefer an
47
47
  outcome-focused check over a vague activity such as "inspect the result."
48
- Starting the intent is the first permitted mutation.
48
+ Starting the intent is the first permitted mutation. Single-step commands that
49
+ only build, check, or record work already done — compiling, running tests,
50
+ `git add`/`git commit` — need no intent of their own.
49
51
 
50
52
  When the round may change or confirm an existing decision, declare each one at
51
53
  the boundary with `--decision <id>`. Do not add decision links speculatively.