@christang/keel 5.95.3 → 5.96.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/assets/bootstrap/AGENTS.md +1 -1
- package/assets/lenses/hardware.md +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/plugins/keel/.claude-plugin/plugin.json +1 -1
- package/plugins/keel/.codex-plugin/plugin.json +1 -1
- package/plugins/keel/skills/keel-tdd-or-test-first/SKILL.md +2 -0
- package/scripts/validate_plugin.py +132 -3
- package/src/core/agents.js +15 -5
- package/src/core/chat/bridge.js +10 -1
- package/src/core/chat/mrkdwn.js +22 -5
- package/src/core/chat/notice.js +2 -1
- package/src/core/context.js +2 -1
- package/src/core/gates.js +3 -2
|
@@ -20,4 +20,4 @@ Prefer behavior evidence appropriate to the layer: simulation or testbench evide
|
|
|
20
20
|
|
|
21
21
|
## Execution and review checks
|
|
22
22
|
|
|
23
|
-
While implementing and reviewing, prove behavior at the interface: drive reset entry and exit, valid-ready handshakes including stall and backpressure, and ordering through simulation before trusting lint; a protocol or CSR field change needs testbench evidence for both legal and illegal accesses. Watch for silent X-propagation, unregistered CDC crossings, and new reset-domain assumptions introduced by the change. In review, reject waveform screenshots without a repeatable run command, require assertion or formal evidence for invariants simulation cannot exhaustively cover, and confirm any golden trace update carries an explicit rationale tied to Acceptance.
|
|
23
|
+
While implementing and reviewing, prove behavior at the interface: drive reset entry and exit, valid-ready handshakes including stall and backpressure, and ordering through simulation before trusting lint; a protocol or CSR field change needs testbench evidence for both legal and illegal accesses. Watch for silent X-propagation, unregistered CDC crossings, and new reset-domain assumptions introduced by the change. Some tools silently accept a broken reference — Verilator binds an SVA to a missing signal as a dangling constant without a warning, so the assertion never fires — and a passing run proves nothing about them; such a reference needs a check of its own, such as a static name check of every bind target. In review, reject waveform screenshots without a repeatable run command, require assertion or formal evidence for invariants simulation cannot exhaustively cover, and confirm any golden trace update carries an explicit rationale tied to Acceptance.
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@christang/keel",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.96.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@christang/keel",
|
|
9
|
-
"version": "5.
|
|
9
|
+
"version": "5.96.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@fission-ai/openspec": "^1.4.1"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keel",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.96.1",
|
|
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.
|
|
3
|
+
"version": "5.96.1",
|
|
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",
|
|
@@ -25,6 +25,8 @@ Read the selected task's compiled capsule: resolved Acceptance, Verify strategy
|
|
|
25
25
|
|
|
26
26
|
Red-green strategies (`vertical-tdd`, `regression-first`) must record concrete per-label `.red` and `.green` Evidence entries for the same check; `keel gate task-complete` rejects absent or pending entries.
|
|
27
27
|
|
|
28
|
+
A check's `Fails with:` declares one literal its red must show. Declare one that every red of the check shares — the scenario or test label the check prints, a stable message prefix — rather than one exception type: a first red is often mixed, mostly one error with a few others, and a literal only some of them carry forces a re-record that predicts nothing new.
|
|
29
|
+
|
|
28
30
|
A check's Evidence may read `artifact <path> sha256:<digest>` instead of retelling the output. `keel gate task-complete` checks the file exists and the digest matches, and refuses a path outside the change's own directory — archiving moves that directory, so a pointer outside it breaks. Keel hashes the bytes and reads nothing inside them: the claim the artifact supports stays yours.
|
|
29
31
|
|
|
30
32
|
## Domain lenses
|
|
@@ -47,8 +47,8 @@ REQUIRED_SCRIPTS = [
|
|
|
47
47
|
"scripts/validate_plugin.py",
|
|
48
48
|
]
|
|
49
49
|
|
|
50
|
-
PACKAGE_VERSION = "5.
|
|
51
|
-
PROTOCOL_VERSION = "5.
|
|
50
|
+
PACKAGE_VERSION = "5.96.1"
|
|
51
|
+
PROTOCOL_VERSION = "5.96.1"
|
|
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
|
|
@@ -3311,7 +3311,9 @@ def validate_chat_bridge_inbound_scenario() -> int:
|
|
|
3311
3311
|
if " - verify" not in owner_record:
|
|
3312
3312
|
report(f"{label} the owner's @verify did not become a mention:\n{owner_record}")
|
|
3313
3313
|
return 1
|
|
3314
|
-
|
|
3314
|
+
# The record is written before the signal is appended (#231), so
|
|
3315
|
+
# wait for the signal rather than reading it once.
|
|
3316
|
+
if not slack.wait_for(lambda: signal.exists() and signal.stat().st_size, 5):
|
|
3315
3317
|
report(f"{label} the owner's mention did not touch verify's signal file.")
|
|
3316
3318
|
return 1
|
|
3317
3319
|
|
|
@@ -3862,6 +3864,82 @@ def validate_chat_slack_format_scenario() -> int:
|
|
|
3862
3864
|
return 0
|
|
3863
3865
|
|
|
3864
3866
|
|
|
3867
|
+
def validate_chat_issue_links_scenario() -> int:
|
|
3868
|
+
"""Owner's request of 2026-10-05: an issue mentioned in Slack links to GitHub.
|
|
3869
|
+
|
|
3870
|
+
`owner/repo#N` links to that repository, and a bare `#N` to the project's
|
|
3871
|
+
own repository read from a GitHub `origin`; `C#`, `abc#9`, and code stay
|
|
3872
|
+
text; a project without a GitHub origin keeps a bare `#N` as text; and an
|
|
3873
|
+
issue link a person sends comes back as the text it showed.
|
|
3874
|
+
"""
|
|
3875
|
+
label = "chat-issue-links:"
|
|
3876
|
+
if chat_bridge_node_missing("chat-issue-links"):
|
|
3877
|
+
return 3
|
|
3878
|
+
FakeSlack = fake_slack_class()
|
|
3879
|
+
with tempfile.TemporaryDirectory(prefix="keel-chat-issues-") as raw, FakeSlack() as slack:
|
|
3880
|
+
base = Path(raw)
|
|
3881
|
+
rtl, _verify, env = chat_scratch_group(base)
|
|
3882
|
+
chat_slack_config(rtl, {"soc": "CSOC"})
|
|
3883
|
+
benv = chat_bridge_environment(env, base / "home", slack)
|
|
3884
|
+
run_keel(rtl, "chat", "bridge", "add", env=benv)
|
|
3885
|
+
subprocess.run(["git", "remote", "remove", "origin"], cwd=rtl, capture_output=True, check=False)
|
|
3886
|
+
subprocess.run(["git", "remote", "add", "origin", "git@github.com:acme/rtl.git"], cwd=rtl, capture_output=True, check=True)
|
|
3887
|
+
|
|
3888
|
+
def posted(body: str) -> str:
|
|
3889
|
+
record_id = chat_json(run_keel(rtl, "chat", "post", "soc", body, "--json", env=benv)).get("id", "")
|
|
3890
|
+
once = run_keel(rtl, "chat", "bridge", "run", "--once", env=benv)
|
|
3891
|
+
sent = next((c["params"].get("text", "") for c in slack.calls_to("chat.postMessage") if slack_payload(c).get("id") == record_id), None)
|
|
3892
|
+
if sent is None:
|
|
3893
|
+
raise AssertionError(f"the record was never posted: {once.stderr.strip()}")
|
|
3894
|
+
if body not in (chat_log(rtl, "soc") / f"{record_id}.md").read_text(encoding="utf-8"):
|
|
3895
|
+
raise AssertionError("linking changed the local record")
|
|
3896
|
+
return sent
|
|
3897
|
+
|
|
3898
|
+
try:
|
|
3899
|
+
sent = posted("see #42, acme/other#7, C# and abc#9 and `#5`")
|
|
3900
|
+
for needle in ("<https://github.com/acme/rtl/issues/42|#42>", "<https://github.com/acme/other/issues/7|acme/other#7>", "C# and abc#9", "`#5`"):
|
|
3901
|
+
if needle not in sent:
|
|
3902
|
+
report(f"{label} the posted text lacks {needle!r}: {sent!r}")
|
|
3903
|
+
return 1
|
|
3904
|
+
subprocess.run(["git", "remote", "remove", "origin"], cwd=rtl, capture_output=True, check=True)
|
|
3905
|
+
sent = posted("see #43 and acme/other#8")
|
|
3906
|
+
if "github.com/acme/rtl" in sent or "see #43 and" not in sent:
|
|
3907
|
+
report(f"{label} a bare #43 was linked although origin is not on GitHub: {sent!r}")
|
|
3908
|
+
return 1
|
|
3909
|
+
if "<https://github.com/acme/other/issues/8|acme/other#8>" not in sent:
|
|
3910
|
+
report(f"{label} acme/other#8 was not linked without an origin: {sent!r}")
|
|
3911
|
+
return 1
|
|
3912
|
+
except AssertionError as error:
|
|
3913
|
+
report(f"{label} {error}")
|
|
3914
|
+
return 1
|
|
3915
|
+
|
|
3916
|
+
bridge = start_chat_bridge(rtl, benv)
|
|
3917
|
+
try:
|
|
3918
|
+
if not slack.wait_for(lambda: slack.sockets, 10):
|
|
3919
|
+
report(f"{label} the bridge never connected: {stop_chat_bridge(bridge).strip()}")
|
|
3920
|
+
return 1
|
|
3921
|
+
slack.push(slack_event("CSOC", user="UOWNER", text="<https://github.com/acme/rtl/issues/42|#42> done", ts="1800000001.000100"))
|
|
3922
|
+
if not slack.wait_for(lambda: chat_records_with(rtl, "soc", "done")):
|
|
3923
|
+
report(f"{label} the owner's message was not imported.")
|
|
3924
|
+
return 1
|
|
3925
|
+
stored = chat_records_with(rtl, "soc", "done")[0]
|
|
3926
|
+
if "#42 done" not in stored or "](" in stored:
|
|
3927
|
+
report(f"{label} the issue link did not come back as its text:\n{stored}")
|
|
3928
|
+
return 1
|
|
3929
|
+
finally:
|
|
3930
|
+
stop_chat_bridge(bridge)
|
|
3931
|
+
|
|
3932
|
+
for relative, needle in (("docs/chat-slack-setup.md", "link to GitHub"), ("docs/chat-slack-setup.zh-CN.md", "跳转到 GitHub")):
|
|
3933
|
+
if needle not in (ROOT / relative).read_text(encoding="utf-8"):
|
|
3934
|
+
report(f"{label} {relative} does not say {needle!r}.")
|
|
3935
|
+
return 1
|
|
3936
|
+
if "chat-issue-links" not in {name for name, _ in SCENARIOS}:
|
|
3937
|
+
report(f"{label} scenario is not registered.")
|
|
3938
|
+
return 1
|
|
3939
|
+
report("chat-issue-links scenario passed.")
|
|
3940
|
+
return 0
|
|
3941
|
+
|
|
3942
|
+
|
|
3865
3943
|
def validate_chat_role_apps_are_documented_scenario() -> int:
|
|
3866
3944
|
"""Issue #187: the setup guides and READMEs describe shared bots.
|
|
3867
3945
|
|
|
@@ -4245,6 +4323,9 @@ def validate_chat_owner_mention_scenario() -> int:
|
|
|
4245
4323
|
if "decide" not in told:
|
|
4246
4324
|
report(f"{label} the notice does not say which messages need @owner: {told!r}")
|
|
4247
4325
|
return 1
|
|
4326
|
+
if "its own message" not in told:
|
|
4327
|
+
report(f"{label} the notice does not say a risk or decision goes in its own message: {told!r}")
|
|
4328
|
+
return 1
|
|
4248
4329
|
|
|
4249
4330
|
run_keel(rtl, "chat", "bridge", "add", env=benv)
|
|
4250
4331
|
record_id = chat_json(run_keel(rtl, "chat", "post", "soc", "@owner 需要你决定 CSR 复位值", "--json", env=benv)).get("id", "")
|
|
@@ -4277,6 +4358,38 @@ def validate_chat_owner_mention_scenario() -> int:
|
|
|
4277
4358
|
return 0
|
|
4278
4359
|
|
|
4279
4360
|
|
|
4361
|
+
def validate_collected_feedback_is_recorded_scenario() -> int:
|
|
4362
|
+
"""Feedback from rtl_ppa_prj sessions on 2026-10-05 reaches Keel's surfaces.
|
|
4363
|
+
|
|
4364
|
+
The codex catalog warns that a run can exit non-zero after its products
|
|
4365
|
+
exist, the general pitfalls warn against `pkill -f`, the bundled hardware
|
|
4366
|
+
lens names tools that silently accept a missing signal, and the tdd skill
|
|
4367
|
+
advises a `Fails with:` literal every red of the check shares.
|
|
4368
|
+
"""
|
|
4369
|
+
label = "collected-feedback-is-recorded:"
|
|
4370
|
+
with tempfile.TemporaryDirectory(prefix="keel-feedback-") as raw:
|
|
4371
|
+
repo = Path(raw)
|
|
4372
|
+
subprocess.run(["git", "init", "-q"], cwd=repo, check=True)
|
|
4373
|
+
shown = run_keel(repo, "agents", "codex").stdout or ""
|
|
4374
|
+
for needle in ("result file", "non-zero", "pkill -f"):
|
|
4375
|
+
if needle not in shown:
|
|
4376
|
+
report(f"{label} `keel agents codex` does not mention {needle!r}.")
|
|
4377
|
+
return 1
|
|
4378
|
+
lens = (ROOT / "assets/lenses/hardware.md").read_text(encoding="utf-8")
|
|
4379
|
+
if "silently" not in lens or "missing signal" not in lens:
|
|
4380
|
+
report(f"{label} the hardware lens does not name tools that silently accept a missing signal.")
|
|
4381
|
+
return 1
|
|
4382
|
+
skill = (ROOT / PLUGIN_ROOT / "skills/keel-tdd-or-test-first/SKILL.md").read_text(encoding="utf-8")
|
|
4383
|
+
if "Fails with:" not in skill or "every red" not in skill:
|
|
4384
|
+
report(f"{label} the tdd skill does not advise a Fails with: literal every red shares.")
|
|
4385
|
+
return 1
|
|
4386
|
+
if "collected-feedback-is-recorded" not in {name for name, _ in SCENARIOS}:
|
|
4387
|
+
report(f"{label} scenario is not registered.")
|
|
4388
|
+
return 1
|
|
4389
|
+
report("collected-feedback-is-recorded scenario passed.")
|
|
4390
|
+
return 0
|
|
4391
|
+
|
|
4392
|
+
|
|
4280
4393
|
def validate_chat_archive_scenario() -> int:
|
|
4281
4394
|
"""Issue #187: chat history is archived to an orphan branch, never exposed.
|
|
4282
4395
|
|
|
@@ -20698,6 +20811,9 @@ def _protocol_refresh_m2(tmp: Path) -> str | None:
|
|
|
20698
20811
|
lines = _protocol_lines(repo)
|
|
20699
20812
|
if len(lines) != 1 or "standing-authorized" not in lines[0]:
|
|
20700
20813
|
return f"M2 context did not read protocol-refresh as authorized: {lines!r}"
|
|
20814
|
+
# Issue #238: the authorization covers the refresh, not its commit.
|
|
20815
|
+
if "committing it is a separate action" not in lines[0]:
|
|
20816
|
+
return f"M2 context does not say committing the refresh is a separate action: {lines!r}"
|
|
20701
20817
|
doctor = run_keel(repo, "--doctor").stdout or ""
|
|
20702
20818
|
if "protocol-refresh: authorized" not in doctor or "commit: not authorized" not in doctor:
|
|
20703
20819
|
return (
|
|
@@ -32312,6 +32428,14 @@ def validate_coverage_claim_is_compared_scenario() -> int:
|
|
|
32312
32428
|
f"{problem_text(quiet)!r}."
|
|
32313
32429
|
)
|
|
32314
32430
|
return 1
|
|
32431
|
+
# Issue #239: the warning names the identifiers that make an entry
|
|
32432
|
+
# compared, so a reader can tell how to make it count.
|
|
32433
|
+
if "D<n>, F<n>, A<n>, or Q<n>" not in said(quiet):
|
|
32434
|
+
report(
|
|
32435
|
+
f"{label}: the uncompared-entry warning does not name the "
|
|
32436
|
+
f"identifiers that count; {said(quiet)!r}."
|
|
32437
|
+
)
|
|
32438
|
+
return 1
|
|
32315
32439
|
|
|
32316
32440
|
# D3: the report's second suggestion is unnecessary, because the
|
|
32317
32441
|
# comparison already refuses the case it was aimed at.
|
|
@@ -36459,6 +36583,10 @@ SCENARIOS: tuple = (
|
|
|
36459
36583
|
"chat-slack-format",
|
|
36460
36584
|
validate_chat_slack_format_scenario,
|
|
36461
36585
|
),
|
|
36586
|
+
(
|
|
36587
|
+
"chat-issue-links",
|
|
36588
|
+
validate_chat_issue_links_scenario,
|
|
36589
|
+
),
|
|
36462
36590
|
(
|
|
36463
36591
|
"chat-archive",
|
|
36464
36592
|
validate_chat_archive_scenario,
|
|
@@ -36723,6 +36851,7 @@ SCENARIOS: tuple = (
|
|
|
36723
36851
|
("directory-tree-is-the-package-renamed", validate_directory_tree_is_the_package_renamed_scenario),
|
|
36724
36852
|
("init-declares-plugin-auto-update", validate_init_declares_plugin_auto_update_scenario),
|
|
36725
36853
|
("context-names-the-protocol-refresh", validate_context_names_the_protocol_refresh_scenario),
|
|
36854
|
+
("collected-feedback-is-recorded", validate_collected_feedback_is_recorded_scenario),
|
|
36726
36855
|
("init-never-downgrades-openspec", validate_init_never_downgrades_openspec_scenario),
|
|
36727
36856
|
("native-plugin-marketplaces", validate_native_plugin_marketplaces_scenario),
|
|
36728
36857
|
("native-plugin-install-matrix", validate_native_plugin_install_matrix_scenario),
|
package/src/core/agents.js
CHANGED
|
@@ -62,6 +62,11 @@ const BUNDLED = {
|
|
|
62
62
|
source: "codex exec --help, codex-cli 0.159.3",
|
|
63
63
|
text: "`-s` takes read-only, workspace-write, or danger-full-access. `-C` sets the directory it works in and `-o` the file its last message is written to.",
|
|
64
64
|
},
|
|
65
|
+
{
|
|
66
|
+
date: "2026-10-05",
|
|
67
|
+
source: "rtl_ppa_prj design session, codex_wcmux run",
|
|
68
|
+
text: "A run can exit non-zero after its products exist: one hit its quota while tidying up and never wrote its result file. Have the brief write the result file before any cleanup, and on a non-zero exit read the products before calling the run failed.",
|
|
69
|
+
},
|
|
65
70
|
],
|
|
66
71
|
},
|
|
67
72
|
dsh: {
|
|
@@ -71,14 +76,14 @@ const BUNDLED = {
|
|
|
71
76
|
sendsTo: "DeepSeek, through the provider the profile configures (by default deepseek-official, model deepseek-flash)",
|
|
72
77
|
pitfalls: [
|
|
73
78
|
{
|
|
74
|
-
date: "2026-10-
|
|
75
|
-
source: "dsh --version, 0.2.0-rc.2",
|
|
76
|
-
text: "The CLI lives inside the app bundle
|
|
79
|
+
date: "2026-10-05",
|
|
80
|
+
source: "ls -l ~/.local/bin/dsh and dsh --version, 0.2.0-rc.2 (rtl_ppa_prj #191)",
|
|
81
|
+
text: "The CLI lives inside the app bundle. A `~/.local/bin/dsh` on PATH, where one exists, is a symlink to that same file, so the catalog keeps the bundle path, which works with or without it.",
|
|
77
82
|
},
|
|
78
83
|
{
|
|
79
84
|
date: "2026-10-05",
|
|
80
|
-
source: "dsh --profile headless, 0.2.0-rc.2",
|
|
81
|
-
text: "
|
|
85
|
+
source: "dsh --profile headless, 0.2.0-rc.2 (rtl_ppa_prj #191)",
|
|
86
|
+
text: "First use needs a DeepSeek API key, stored once through the app's Models page or exported as DEEPSEEK_API_KEY where it is launched; until then the headless profile fails with MISSING_CREDENTIAL. With the key stored it runs from any directory.",
|
|
82
87
|
},
|
|
83
88
|
{
|
|
84
89
|
date: "2026-10-04",
|
|
@@ -96,6 +101,11 @@ const BUNDLED = {
|
|
|
96
101
|
|
|
97
102
|
// Pitfalls of handing work to any external process, whichever CLI it is.
|
|
98
103
|
const GENERAL_PITFALLS = [
|
|
104
|
+
{
|
|
105
|
+
date: "2026-10-05",
|
|
106
|
+
source: "rtl_ppa_prj verify session",
|
|
107
|
+
text: "Stop a delegate by its PID or by its own output directory, never `pkill -f <pattern>`: a pattern matched other sessions' processes of the same command and killed them, twice in one day.",
|
|
108
|
+
},
|
|
99
109
|
{
|
|
100
110
|
date: "2026-10-04",
|
|
101
111
|
source: RTL_TOOLCHAIN,
|
package/src/core/chat/bridge.js
CHANGED
|
@@ -172,7 +172,7 @@ function bodyText(record) {
|
|
|
172
172
|
// `[redacted]`, and neither the cut pointer nor the owner mention is Markdown
|
|
173
173
|
// to translate (chat-slack-format D1).
|
|
174
174
|
function slackText(project, record, text) {
|
|
175
|
-
let result = mrkdwn.toSlack(redact(text));
|
|
175
|
+
let result = mrkdwn.toSlack(redact(text), { repo: project.github });
|
|
176
176
|
if (result.length > TEXT_LIMIT) {
|
|
177
177
|
result = `${result.slice(0, TEXT_LIMIT)}… (cut; full text: \`keel chat show ${record.id}\`)`;
|
|
178
178
|
}
|
|
@@ -850,10 +850,19 @@ function prepareProjects() {
|
|
|
850
850
|
if (!project.channelGroups.has(channel)) project.channelGroups.set(channel, group);
|
|
851
851
|
}
|
|
852
852
|
buildTsIndex(project);
|
|
853
|
+
project.github = githubRepo(project.where.worktree);
|
|
853
854
|
}
|
|
854
855
|
return projects;
|
|
855
856
|
}
|
|
856
857
|
|
|
858
|
+
// `owner/repo` of the project's `origin` when it is on GitHub, which a bare
|
|
859
|
+
// `#N` in a record links to (chat-issue-links D1); null otherwise.
|
|
860
|
+
function githubRepo(worktree) {
|
|
861
|
+
const result = require("child_process").spawnSync("git", ["remote", "get-url", "origin"], { cwd: worktree, encoding: "utf8", timeout: 5000 });
|
|
862
|
+
const match = String(result.stdout || "").trim().match(/github\.com[:/]([\w.-]+\/[\w.-]+?)(?:\.git)?\/?$/);
|
|
863
|
+
return result.status === 0 && match ? match[1] : null;
|
|
864
|
+
}
|
|
865
|
+
|
|
857
866
|
async function createContext(log, { needApp }) {
|
|
858
867
|
requireWebSocket();
|
|
859
868
|
const { bot, app } = lifecycle.tokens();
|
package/src/core/chat/mrkdwn.js
CHANGED
|
@@ -16,6 +16,11 @@ const BOLD = "\u0001";
|
|
|
16
16
|
// on each side of every marker pair supplies the boundary, checked against
|
|
17
17
|
// real Slack on 2026-10-05 (#187). Inbound text drops them again.
|
|
18
18
|
const ZWSP = "\u200b";
|
|
19
|
+
// An issue reference at a word boundary, `owner/repo#N` or a bare `#N`, and
|
|
20
|
+
// any Slack link already made, which is matched first so that a reference
|
|
21
|
+
// inside one is left alone (chat-issue-links D3).
|
|
22
|
+
const ISSUE = /(<[^>\n]*>)|(?<![\w#/;&.-])((?:([\w.-]+\/[\w.-]+))?#(\d{1,7}))(?![\w#])/g;
|
|
23
|
+
const ISSUE_LINK = /<https:\/\/github\.com\/[\w.-]+\/[\w.-]+\/(?:issues|pull)\/\d+\|((?:[\w.-]+\/[\w.-]+)?#\d+)>/g;
|
|
19
24
|
|
|
20
25
|
// Calls `prose` on the text outside code and `code` on the code itself.
|
|
21
26
|
function byCode(text, prose, code) {
|
|
@@ -45,9 +50,20 @@ function unescape(text) {
|
|
|
45
50
|
return text.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
|
|
46
51
|
}
|
|
47
52
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
// `owner/repo#N` links to that repository; a bare `#N` to `repo`, the
|
|
54
|
+
// project's own GitHub repository, and stays text without one (D1, D2).
|
|
55
|
+
function linkIssues(text, repo) {
|
|
56
|
+
return text.replace(ISSUE, (match, link, ref, named, number) => {
|
|
57
|
+
if (link) return link;
|
|
58
|
+
const target = named || repo;
|
|
59
|
+
if (!target) return match;
|
|
60
|
+
return `<https://github.com/${target}/issues/${number}|${ref}>`;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function proseToSlack(text, repo) {
|
|
65
|
+
return linkIssues(escape(text)
|
|
66
|
+
.replace(/\[([^\]\n]+)\]\((https?:\/\/[^)\s]+|mailto:[^)\s]+)\)/g, (match, label, url) => `<${url}|${label}>`), repo)
|
|
51
67
|
.replace(/^(\s*)[-*+][ \t]+/gm, "$1• ")
|
|
52
68
|
.replace(/^#{1,6}[ \t]+(.+?)[ \t]*#*[ \t]*$/gm, `${BOLD}$1${BOLD}`)
|
|
53
69
|
.replace(/\*\*(?!\s)([^\n]+?)\*\*/g, `${BOLD}$1${BOLD}`)
|
|
@@ -59,6 +75,7 @@ function proseToSlack(text) {
|
|
|
59
75
|
|
|
60
76
|
function proseFromSlack(text) {
|
|
61
77
|
return unescape(text.split(ZWSP).join("")
|
|
78
|
+
.replace(ISSUE_LINK, "$1")
|
|
62
79
|
.replace(/<((?:https?:\/\/|mailto:)[^|>\s]+)\|([^>]+)>/g, "[$2]($1)")
|
|
63
80
|
.replace(/<((?:https?:\/\/|mailto:)[^|>\s]+)>/g, "$1")
|
|
64
81
|
.replace(/(^|[^\w*])\*(?![\s*])([^*\n]+?)\*(?![\w*])/g, `$1${BOLD}${BOLD}$2${BOLD}${BOLD}`)
|
|
@@ -67,8 +84,8 @@ function proseFromSlack(text) {
|
|
|
67
84
|
.split(BOLD).join("*"));
|
|
68
85
|
}
|
|
69
86
|
|
|
70
|
-
function toSlack(text) {
|
|
71
|
-
return byCode(String(text || ""), proseToSlack, escape);
|
|
87
|
+
function toSlack(text, { repo = null } = {}) {
|
|
88
|
+
return byCode(String(text || ""), (prose) => proseToSlack(prose, repo), escape);
|
|
72
89
|
}
|
|
73
90
|
|
|
74
91
|
function fromSlack(text) {
|
package/src/core/chat/notice.js
CHANGED
|
@@ -148,7 +148,8 @@ function bridgeLine(where) {
|
|
|
148
148
|
// the owner only for a mention, and the bridge mentions them only for
|
|
149
149
|
// `@owner`, so whether a message reaches their phone is the session's choice.
|
|
150
150
|
const OWNER_RULE = "Slack notifies the owner only for messages that write `@owner`: write it in any message the owner "
|
|
151
|
-
+ "needs to see or decide on, and leave it out of routine discussion."
|
|
151
|
+
+ "needs to see or decide on, and leave it out of routine discussion. Send a risk or decision as its own message "
|
|
152
|
+
+ "with `@owner` rather than inside a status update.";
|
|
152
153
|
|
|
153
154
|
const HOST_EVENTS = {
|
|
154
155
|
"session-start": "SessionStart",
|
package/src/core/context.js
CHANGED
|
@@ -792,7 +792,8 @@ function renderProtocol(protocol) {
|
|
|
792
792
|
}
|
|
793
793
|
return protocol.authorized
|
|
794
794
|
? `${head} — standing-authorized (authorize: protocol-refresh); run it `
|
|
795
|
-
+ "before other work and leave the diff
|
|
795
|
+
+ "before other work and leave the diff uncommitted: the authorization "
|
|
796
|
+
+ "covers the refresh, and committing it is a separate action"
|
|
796
797
|
: `${head} — ask before running it; keel/config.yaml does not `
|
|
797
798
|
+ "standing-authorize protocol-refresh";
|
|
798
799
|
}
|
package/src/core/gates.js
CHANGED
|
@@ -2137,8 +2137,9 @@ function expectationProblems(repo, content, tasks, change) {
|
|
|
2137
2137
|
? `Expectation Coverage: compared ${compared} of ${compared + uncited} `
|
|
2138
2138
|
+ `\`Covered by:\` ${compared + uncited === 1 ? "entry" : "entries"} `
|
|
2139
2139
|
+ `against the Covers of the task named; ${uncited} cited no `
|
|
2140
|
-
+
|
|
2141
|
-
+ "compared
|
|
2140
|
+
+ "D<n>, F<n>, A<n>, or Q<n> identifier before `Covered by:` and "
|
|
2141
|
+
+ `${uncited === 1 ? "was" : "were"} not compared`
|
|
2142
|
+
+ (uncited > 0 ? " (cite one there, as in `E1: … (D2). Covered by: 1.1`)." : ".")
|
|
2142
2143
|
: null;
|
|
2143
2144
|
return { problems, report };
|
|
2144
2145
|
}
|