@christang/keel 5.99.1 → 5.99.2

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.
@@ -1,4 +1,4 @@
1
- <!-- keel:start version=5.99.1 -->
1
+ <!-- keel:start version=5.99.2 -->
2
2
  ## Keel Bootstrap
3
3
 
4
4
  - Start every session with `keel context`; OpenSpec artifacts and Git are the only durable authority — never native memory, goals, or transcripts.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@christang/keel",
3
- "version": "5.99.1",
3
+ "version": "5.99.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@christang/keel",
9
- "version": "5.99.1",
9
+ "version": "5.99.2",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@fission-ai/openspec": "^1.4.1"
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@christang/keel",
3
3
  "displayName": "Keel",
4
4
  "description": "Keel OpenSpec execution discipline CLI for Claude Code, Codex, and OpenCode.",
5
- "version": "5.99.1",
5
+ "version": "5.99.2",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keel",
3
- "version": "5.99.1",
3
+ "version": "5.99.2",
4
4
  "description": "Keel OpenSpec execution discipline: stateless continuity, task capsules, deterministic gates, and expectation alignment for Codex and Claude Code.",
5
5
  "author": {
6
6
  "name": "TanglmChris",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keel",
3
- "version": "5.99.1",
3
+ "version": "5.99.2",
4
4
  "description": "Keel OpenSpec execution discipline: stateless continuity, task capsules, deterministic gates, and expectation alignment for Codex and Claude Code.",
5
5
  "author": {
6
6
  "name": "TanglmChris",
@@ -47,8 +47,8 @@ REQUIRED_SCRIPTS = [
47
47
  "scripts/validate_plugin.py",
48
48
  ]
49
49
 
50
- PACKAGE_VERSION = "5.99.1"
51
- PROTOCOL_VERSION = "5.99.1"
50
+ PACKAGE_VERSION = "5.99.2"
51
+ PROTOCOL_VERSION = "5.99.2"
52
52
  LEGACY_MANAGED_START = "<!-- keel:start version=2.1 -->"
53
53
  OPENSPEC_SCHEMA_NAME = "keel-spec-driven"
54
54
  # Mirrors KEEL_PACKAGE_NAME in scripts/install_to_repo.py, one of the two
@@ -4715,6 +4715,37 @@ def validate_shift_without_role_scenario() -> int:
4715
4715
  report(f"{label} keel context still points to a note already resumed.")
4716
4716
  return 1
4717
4717
 
4718
+ # Issue #261: `--file -` is stdin, and an unreadable file is a named refusal.
4719
+ missing = base / "missing-note.md"
4720
+ refused = run_keel(repo, "shift", "ready", "--file", str(missing), env=env)
4721
+ if re.search(r"^\s+at ", refused.stderr, re.M):
4722
+ report(f"{label} an unreadable --file escaped as an uncaught exception: {refused.stderr.strip()}")
4723
+ return 1
4724
+ if refused.returncode != 1:
4725
+ report(f"{label} an unreadable --file exited {refused.returncode}, not 1: {refused.stderr.strip()}")
4726
+ return 1
4727
+ if not refused.stderr.startswith("keel shift:"):
4728
+ report(f"{label} an unreadable --file was not refused as a keel shift error: {refused.stderr.strip()}")
4729
+ return 1
4730
+ if str(missing) not in refused.stderr:
4731
+ report(f"{label} the refusal of an unreadable --file does not name the path: {refused.stderr.strip()}")
4732
+ return 1
4733
+ piped = subprocess.run(
4734
+ ["node", str(ROOT / "bin" / "keel.js"), "shift", "ready", "--file", "-"],
4735
+ cwd=repo, env=env, input="next: from stdin via --file -\n",
4736
+ text=True, encoding="utf-8", errors="replace", capture_output=True, check=False,
4737
+ )
4738
+ if piped.returncode != 0:
4739
+ report(f"{label} keel shift ready --file - failed: {piped.stderr.strip()}")
4740
+ return 1
4741
+ notes = list((common / "shift" / "worktree").glob("*.md"))
4742
+ if len(notes) != 1:
4743
+ report(f"{label} keel shift ready --file - kept {len(notes)} worktree notes, not one.")
4744
+ return 1
4745
+ if "from stdin via --file -" not in notes[0].read_text(encoding="utf-8"):
4746
+ report(f"{label} the note stored by keel shift ready --file - lacks the text given on stdin.")
4747
+ return 1
4748
+
4718
4749
  for relative, needle in (("docs/shift-change.md", "no chat role"), ("docs/shift-change.zh-CN.md", "不绑定聊天角色")):
4719
4750
  if needle not in (ROOT / relative).read_text(encoding="utf-8"):
4720
4751
  report(f"{label} {relative} does not say a chat role is optional ({needle!r}).")
package/src/core/shift.js CHANGED
@@ -268,7 +268,14 @@ function request(where, role, text) {
268
268
  }
269
269
 
270
270
  function readNoteText(options) {
271
- if (options.file) return fs.readFileSync(options.file, "utf8");
271
+ if (options.file) {
272
+ // `-` is stdin, as without --file (D1); any other failure is named (D2).
273
+ try {
274
+ return fs.readFileSync(options.file === "-" ? 0 : options.file, "utf8");
275
+ } catch (error) {
276
+ throw new ShiftError(`Cannot read the shift note from --file ${options.file}: ${error.code || error.message}.`);
277
+ }
278
+ }
272
279
  if (options.text) return options.text;
273
280
  if (!process.stdin.isTTY) {
274
281
  try {