Commit Graph
4342 Commits
Author SHA1 Message Date
haelyra 02e99f5be4 Merge reviewed PR #3833 2026-11-05 23:09:32 -05:00
haelyra 22596737f7 Merge reviewed PR #3829 2026-11-05 23:09:32 -05:00
haelyra 759a3ba299 Merge reviewed PR #3822 2026-11-05 23:09:32 -05:00
haelyra 44de2e5996 Merge reviewed PR #3814 2026-11-05 23:09:32 -05:00
haelyra 14221ef652 Merge reviewed PR #3881 2026-11-05 23:09:32 -05:00
haelyra 9ac25823ff Merge reviewed PR #3857 2026-11-05 23:09:32 -05:00
haelyra a608b1f798 Merge reviewed PR #3827 2026-11-05 23:09:32 -05:00
haelyra b2018455d5 Merge reviewed PR #3855 2026-11-05 23:09:32 -05:00
haelyra 612cba644a Merge reviewed PR #3824 2026-11-05 23:09:31 -05:00
Cheese 4385863e56 fix(scripts): reject inherited package manager names 2026-11-06 11:52:10 +08:00
AlexisLeDain 676f3f3daf docs: exempt deliberate boundaries from the second-caller rule
As written, the bullet banned any interface with a single implementation,
which contradicts the Repository Pattern in rules/common/patterns.md: it
requires business logic to depend on an abstract repository interface,
and a project backed by one database has exactly one implementation.

Scope the rule to speculative abstractions and name the exemption, so the
two files in rules/common/ no longer give opposite instructions.
2026-11-04 09:42:54 +01:00
AlexisLeDainandClaude Opus 5 1cf547bfd7 docs: make YAGNI and root-cause rules concrete
The YAGNI section states the principle three times in the abstract
("avoid speculative generality", "introduce abstractions when repetition
is real") without naming a threshold an agent can test against. The same
gap exists in the review checklist for bug fixes: nothing tells a
reviewer to look past the reported symptom.

Add one bullet to each, both phrased as a check rather than an
aspiration: the second caller as the bar for introducing an abstraction,
and the sibling callers as the bar for accepting a bug fix.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-11-03 17:10:00 +01:00
Iain f408fb12d4 docs: say the package manager fallback is npm 2026-11-03 15:33:20 +00:00
Tawhidul Islam 66a96a5fdb fix(pi): show ecc-doctor report immediately when run 2026-11-01 19:40:43 +06:00
Muhammad Mirza f6357e73ee test(continuous-learning): override Windows temp vars in marker failure test
Both reviewers noted the marker write-failure test only overrides TMPDIR,
which Node ignores on Windows (os.tmpdir reads TEMP/TMP there), so the
test would fail in the Windows CI lane. Set TEMP and TMP alongside TMPDIR;
on POSIX the extra vars are ignored by os.tmpdir.

Test plan:
- tests/hooks/evaluate-session.test.js: 25 passed, 0 failed
- Windows behavior cannot be verified from this Linux host; the change
  follows both reviewers' prescription exactly.
2026-10-31 23:53:17 +07:00
Muhammad Mirza 3e7b4d74b9 fix(continuous-learning): sync Stop hook and fail-closed delivery marker
Address bot review on the Stop delivery path: the stop:evaluate-session
registration no longer carries async (an async Stop registration cannot
block), so delivery is synchronous, and the metadata fingerprint for the
changed entry is regenerated with the repo's own function; the delivery
marker is now claimed atomically with exclusive create and any write
failure fails closed instead of delivering without once-per-session
protection; the skill doc now marks the shell entry as counting-only,
requires the JavaScript evaluator through the plugin hooks for delivery,
and clarifies that Stop fires whenever Claude finishes responding; test
spawn helpers no longer coerce a failed spawn to exit 0.

Test plan:
- tests/hooks/evaluate-session.test.js: 25 passed, 0 failed (2 new:
  marker write failure skips delivery, registration is synchronous);
  pristine comparison: 22 passed, 3 failed (delivery, marker, registration)
- tests/hooks/hooks.test.js: 260 passed
- tests/hooks/stop-hooks-stdout.test.js: 48 passed
- tests/hooks/cursor-hook-dispatchers.test.js: 27 passed
- tests/integration/hooks.test.js: 27 passed
- scripts/ci/check-unicode-safety.js: passed
2026-10-31 23:36:38 +07:00
Muhammad Mirza Kurniawan f82eb1414b fix(continuous-learning): deliver v1 Stop nudge via native Stop contract behind explicit opt-in
The v1 evaluator computed the learning signal but wrote it to stderr, which Claude Code never forwards to the model, so the learned-skills folder was never populated through this path.

Delivery now follows the maintainer-endorsed shape: an explicit stop_nudge_opt_in flag (default off, so existing installs are unchanged), the native Stop block contract (decision block plus reason) instead of plain stdout text, at most one delivery per session via a temp-dir marker, Stop-loop protection via stop_hook_active, and delivery only for sessions with a registered lease from SessionStart.

Tests: 7 new evaluator tests (opt-in off, no lease, one valid block then silence on repeat, stop_hook_active, short session, non-Stop event, missing session id). Evaluator suite 23/23 with the fix, failing on pristine; hooks suite 260/260; Stop stdout contract suite 48/48.

Limits stated plainly: end-to-end delivery in a live Claude Code session is not certified from this host (unit-level spawn plus parse only), and the fix ships inert by default until a user opts in.
2026-10-31 22:40:13 +07:00
Joel PodolskyandClaude Opus 5.5 8aab80221d fix(openclaw-persona-forge): print gacha output as UTF-8 on non-UTF-8 stdout
On Windows, piped stdout defaults to cp1252, so `python3 gacha.py` crashed
on its first banner line with UnicodeEncodeError. That covers agent shell
tools and gacha.sh. Reconfigure stdout to UTF-8 before main(), the same
approach instinct-cli.py took for #1855.

The existing tests set PYTHONUTF8=1, which hid the crash. The new case
forces PYTHONIOENCODING=cp1252 without PYTHONUTF8, so it reproduces on any
OS: it fails on the previous gacha.py and passes with this change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 03:30:22 -04:00
Iain f914d617fd fix(hooks): accept the ! breaking-change marker in commit-quality 2026-10-30 22:46:01 +00:00
Quinn O'Donnell 00a8fe96f8 fix(hooks): skip stdin listeners on require and match exact tsc paths in post-edit-typecheck
config-protection.js and post-edit-typecheck.js attached process.stdin
listeners at module scope. tests/hooks/hook-input.test.js requires
config-protection.js, so that test never exits while stdin stays open.
Attach the listeners only when the script runs directly
(require.main === module), as stop-format-typecheck.js and quality-gate.js
already do.

post-edit-typecheck.js picked tsc diagnostics with line.includes(candidate),
so editing a root index.ts reported the errors of src/index.ts, and a
Windows relative path (src\index.ts) never matched tsc's forward-slash
output. Compare the file at the start of each diagnostic instead, the same
check diagnosticMatchesFile() does in stop-format-typecheck.js.

Refs #3821
2026-10-30 12:29:32 -04:00
rabbit-collabandClaude Opus 5.5 21d651cb8e fix: exit hook runners whose parent process is gone
On Windows, Claude Code kills an overrunning hook by killing the bash.exe
wrapper; the node.exe runner underneath survives. If another process still
holds the write end of the runner's stdin (a handle inherited by a process
spawned at the same moment), the runner never sees EOF and waits forever.
Orphaned runners were observed living 3-18 hours.

Add scripts/hooks/hook-watchdog.js and start it from the four hook entry
points (plugin-hook-bootstrap, run-with-flags, posttooluse-dispatcher,
lifecycle-hook-bootstrap). It exits the process when the parent PID is gone
(Windows) or the process was re-parented (POSIX), polled every 2s, or when a
hard deadline passes (330s, above the longest hooks.json timeout, or an
earlier inherited ECC_HOOK_DEADLINE_MS). Timers are unref'd so a finished
hook is never kept alive.

The regression test reproduces the leak with a detached runner whose stdin
write end is held by an unrelated process; it fails without the watchdog
(runner still alive after 8s) and passes with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 03:08:18 -07:00
haelyra b38be6a7f6 Merge pull request #3809 from affaan-m/maint/pr-continuation-20261029
Integrate seven reviewed ECC reliability and guidance fixes
2026-10-29 20:06:32 -07:00
haelyra 66d7b0587b chore(context): bind curated triggers to reviewed guidance repairs 2026-10-29 19:43:24 -07:00
haelyra fafdfb5de6 Merge independently reviewed context budget and reminder repairs 2026-10-29 19:42:36 -07:00
haelyra 35769d00d9 fix(context): validate budgets and remind before native compaction
Reject numeric prefixes, fractions and unsafe window integers consistently with summary scheduling while preserving resolver precedence. Cap only the default context reminder at eighty percent of a valid earlier native compaction budget; explicit thresholds, including zero, retain their intentional policy. Document the independent capacity, summary and advisory contracts.

RED controls reproduce malformed-budget summary triggers and the known-1M/native-200k missed reminder. Resolver65, helper47, actualStop18 and actualPreToolUse54 pass on Node18 and24. Parent and independent reviewer approved the exact diff before commit. Registry rebinding remains the integration coordinator responsibility after combining documentation repairs.
2026-10-29 19:42:27 -07:00
haelyra e4f2f88a32 docs(tinystruct): validate example login inputs before authentication
Add null, blank and example-specific UTF-16 length checks to the English and Japanese login snippets before AuthService. Preserve credential bytes, authentication-failure behavior and the existing successful-session flow. Label the 256/1024 limits as application examples rather than tinystruct defaults.

Compile and execute exact extracted methods against controlled request/auth/session stubs with ephemeral official checksum-verified Temurin17. Baseline: 8 pass,20 fail. Candidate:28 pass,0 fail. Tagged Request API and Java17 target verified. Markdownlint, Unicode and diff checks pass. Root independently reviewed both documents. No full HTTP host, real authentication service, cookie-policy or envelope changes claimed; registry rebound remains root-owned.
2026-10-29 19:40:29 -07:00
haelyra 1739020dba test: preserve exact monitor assertions with actionable diagnostics 2026-10-29 19:15:56 -07:00
haelyra e645a75c2a test: make invalid payment signatures deterministic 2026-10-29 19:15:56 -07:00
haelyra 05bc52ae83 test(insaits): report captured monitor failure diagnostics
Include captured stderr, status, signal and spawn error message when the existing unexpected-monitor-failure warning assertions fail. Preserve all status/raw-input/warning assertions, deadlines and product bytes.

The macOS hosted failure did not print its actual stderr, so its transient cause remains unverified. The unchanged source matches green main; 24 prior local diagnostic repeats passed 120 checks. This diagnostic-only patch passes all five fixture cases, affected ESLint and diff checks. Parent independently reviewed the diff. Fresh exact-head hosted CI remains required.
2026-10-29 19:15:02 -07:00
haelyra eb267762a1 test(x402): reject a provably invalid ECDSA scalar
Zero the 32-byte r scalar while preserving the signature encoding, length, s and recovery byte. The previous tail overwrite could leave r/s unchanged and normalize recovery 27 to 0, preserving a valid payment. Keep and strengthen no-claim/no-handler/no-settlement checks before serving the original valid payment.
2026-10-29 19:14:07 -07:00
haelyra 3dca6e2e88 fix(hooks): preserve provider conversation identity under inherited environments
Restore the shipped payload-first contract from #3464/#3495 and the explicit source #3755 scope clarification. Two provider conversations must retain distinct IDs despite an inherited registered ECC parent ID. Normal and ambient producer24 tests, canonical resolver10 and independent differential review pass. Keep native importer guards; explicit provider/native correlation is queued separately.
2026-10-29 18:57:29 -07:00
haelyra 794d8cd8d1 fix(context): bind final reviewed guidance registry
Bind canonical context guidance and tagged-source security qualifications after combined review repairs. Preserve all34 curated trigger lists. Context profiles, carrier closure, Pi generation, workflow security and diff validation passed.
2026-10-29 17:45:08 -07:00
haelyra 0fae27de35 docs: qualify tinystruct static-root protections against pinned source 2026-10-29 17:44:54 -07:00
haelyra d1eba24d5f fix(hooks): attribute native activity to the registered ECC session 2026-10-29 17:44:10 -07:00
haelyra e4b8b8bf01 docs(tinystruct): qualify symlinked static-root protection
Correct the English and Japanese static-file guidance against tinystruct v1.7.37 commit 089ec19022f3bb5d87f1e83e30b2034b24f7e77f. The configured-root exclusion uses lexical normalized paths before symlink resolution, and matching static candidates return before the later project-root-file check. Recommend real dedicated public directories without claiming an upstream security repair.

Verified the exact tagged HttpServer blob 58ff6ae082f7569e73207c9cb4614f680c9d3de7 and eight disposable POSIX filesystem path controls. Java is unavailable, so no Java or HTTP runtime verification is claimed. Changed Markdownlint, Unicode safety and diff checks pass. Parent independently reviewed both documents and the source evidence. Registry rebinding remains with the combined integration.
2026-10-29 17:44:04 -07:00
haelyra 27e257f59f fix(ci): verify pinned Windows ripgrep before running test gates 2026-10-29 17:43:59 -07:00
haelyra 96996a13c7 docs: separate summary budgets from context capacity guidance
Clarify native compaction budget scheduling independently of the model window resolver and retain immutable transcript fixtures. Helper43, ten independent scheduling controls, affected lint and independent review passed.
2026-10-29 17:43:59 -07:00
haelyra 6cd41995f4 fix(hooks): attribute native activity to the registered ECC session
Verify review discussion4419348312 against actual native producer/importer behavior. Prefer the independently sanitized ECC_SESSION_ID for the ECC-owned metrics feed, retain payload then legacy fallback for standalone hooks, and leave sibling hooks unchanged.

Actual Node producer plus read-only cached native binary reproduces zero imported metrics before the fix and exactly one tool/file/log after repeated sessions/status commands. Four producer regression controls and normal/adversarial inherited-env suites pass22/22. Focused coverage96.47percent lines and91.47percent branches; parent independent source review passed.
2026-10-29 17:43:55 -07:00
haelyra 5fd527cf66 fix(ci): verify pinned Windows ripgrep without Chocolatey
Prefer a preinstalled rg application. Otherwise download the official ripgrep 15.2.0 x64 MSVC ZIP with bounded HTTP retries/timeouts, verify its committed SHA256 before extraction and execution, validate rg.exe, and publish its directory through GITHUB_PATH. Preserve the existing version and PCRE2 checks and every test lane.
2026-10-29 17:41:29 -07:00
haelyra b37942d3c1 fix(summary): preserve work before the earlier compaction boundary
Separate confirmed model capacity from Stop-summary scheduling. Use the smaller confirmed capacity/native budget, or native-only budget for inferred capacity. Three unit and one actual hook RED cases now pass; helper43, actualStop15 and ten independent controls pass without changing the capacity resolver.
2026-10-29 17:37:52 -07:00
haelyra f75d8322f6 fix(context): rebind registry after verified review repairs
Bind the combined canonical skill changes to registry1bc6b059 while retaining all34 curated trigger lists and their unchanged digest. Context profile and deterministic Pi validation passed after integration.
2026-10-29 17:28:55 -07:00
haelyra 3a9f2f9580 docs: clarify context fallback and tinystruct transport dependencies 2026-10-29 17:27:56 -07:00
haelyra 54464e0b78 fix(skills): harden reviewed TypeScript assertions and request IDs 2026-10-29 17:27:56 -07:00
haelyra fee046c6a0 fix(ecc2): retain persisted tool event ownership on replay 2026-10-29 17:27:56 -07:00
haelyra fc549b6372 fix: preserve Windows rule examples and conservative summary budgets
Address #3809 review regressions for CRLF code fences and inferred context capacity. Reproduced unit and actual Stop-hook failures; verified llm-summary38, Stop14, Copilot37 and independent code/security review. Keep confirmed model/ECC context authority, native budget scheduling and unknown capacity separate.
2026-10-29 17:27:56 -07:00
haelyra ca24fb12c0 docs: clarify compact fallback and tinystruct transport dependencies
Verify context fallback order against transcript-context and passing 55-case workflow suite. Ground CLI injection guidance in tinystruct v1.7.37 Action.getArguments, CommandLine and ApplicationManager at 089ec19022f3bb5d87f1e83e30b2034b24f7e77f. Markdown lint and Pi projection check pass; preserve explicit Pi exclusions.
2026-10-29 17:25:46 -07:00
haelyra 6b8c757e54 fix(skills): validate TypeScript example arrays and request identifiers
Verify and address PR #3809 discussions 4419228221, 4419257840 and 4419257844. Iterate string-array assertions through sparse positions, validate the declared example identifier grammar before request construction, and refresh Turkish/Chinese reviewer references. Regenerate the canonical Pi copy.

Compile and execute the actual typed fixture; keep published validation bodies aligned and prove invalid identifiers never call fetch. RED: 28 pass, 2 fail. GREEN: 30 pass, 0 fail. Strict tsc, changed ESLint/Markdownlint, Unicode/agent/skill validators and deterministic Pi checks pass. Parent independently reviewed all six paths. Registry rebinding is deferred to the combined integration.
2026-10-29 17:25:42 -07:00
haelyra e55b9c1346 fix(ecc2): preserve persisted tool event ownership on replay
Reject a feed row whose hook event ID already belongs to another session before reserving in-memory deduplication. Reuse one parameterized indexed lookup rather than loading historical logs. Register the previously unknown session against the unchanged same-ID fixture and verify metrics remain consistent with persisted ownership.
2026-10-29 17:25:41 -07:00
haelyra 829b8e42d6 fix(deps): integrate rustls 0.23.46 security update (#3807)
Preserve the reviewed Dependabot source ancestry. The rustls patch release addresses four advisories affecting 0.23.45; dependency closure is unchanged. Verified downloaded crate checksum, full native tests, actual CLI readback fixtures, and locked offline build.
2026-10-29 17:07:35 -07:00
haelyra 3f844bd175 fix(context): bind curated triggers to combined reviewed registry
Recompute only registryDigest through the canonical registry after tinystruct and TypeScript integration; retain all 34 curated trigger lists and their verified digest. Context profiles, carrier closure, Pi projection and independent combined review passed.
2026-10-29 17:05:17 -07:00