@codyswann/lisa 4.73.5 → 4.73.7

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.
Files changed (63) hide show
  1. package/README.md +8 -6
  2. package/all/copy-overwrite/scripts/lisa-enforcement-fallback.sh +37 -26
  3. package/all/copy-overwrite/scripts/lisa-enforcement-freshness.mjs +10 -0
  4. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  5. package/dist/core/lisa-owned-hash-ledger.js +8 -0
  6. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  7. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  8. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  9. package/dist/core/upstream-evidence-manifest.js +5 -4
  10. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  11. package/package.json +4 -4
  12. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  13. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  14. package/plugins/lisa-agy/plugin.json +1 -1
  15. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  16. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  17. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  18. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  19. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  20. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  21. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  22. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  23. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  24. package/plugins/lisa-expo-agy/plugin.json +1 -1
  25. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  26. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  27. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  28. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  29. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  30. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  31. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  32. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  33. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  34. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  35. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  38. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  39. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  40. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  43. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  44. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  45. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  46. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  48. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  49. package/plugins/lisa-rails-agy/plugin.json +1 -1
  50. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  52. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  53. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  54. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  55. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  57. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  59. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  60. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  62. package/scripts/lisa-enforcement-fallback.sh +37 -26
  63. package/scripts/lisa-enforcement-freshness.mjs +10 -0
package/package.json CHANGED
@@ -189,7 +189,7 @@
189
189
  "qs": "^6.16.0"
190
190
  },
191
191
  "name": "@codyswann/lisa",
192
- "version": "4.73.5",
192
+ "version": "4.73.7",
193
193
  "description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
194
194
  "main": "dist/index.js",
195
195
  "exports": {
@@ -345,7 +345,7 @@
345
345
  "test": "tests"
346
346
  },
347
347
  "types": "./dist/index.d.ts",
348
- "lisaReleaseCommit": "c2f416b4787953f49a663a5d91d197041bca6ce9",
349
- "gitHead": "c2f416b4787953f49a663a5d91d197041bca6ce9",
350
- "lisaReleaseTag": "v4.73.5"
348
+ "lisaReleaseCommit": "53bb5c2d3aaceb76f28df9b73b8c0b331928d776",
349
+ "gitHead": "53bb5c2d3aaceb76f28df9b73b8c0b331928d776",
350
+ "lisaReleaseTag": "v4.73.7"
351
351
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Universal governance: agents, skills, commands, hooks, and rules for all projects.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "AWS CDK-specific Lisa plugin.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Expo and React Native-specific skills, agents, rules, and MCP servers.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Harper/Fabric-specific Lisa rules for TypeScript component apps.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "NestJS-specific skills and migration write-protection hooks.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, across Claude and Codex.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Ruby on Rails-specific skills and hooks for RuboCop and ast-grep scanning on edit.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "TypeScript-specific hooks for formatting, linting, and ast-grep scanning on edit.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "Distributable LLM Wiki kernel — ingest, query, lint, and maintain a git-native markdown knowledge base across Claude and Codex.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "4.73.5",
3
+ "version": "4.73.7",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -208,15 +208,15 @@ note_version() {
208
208
 
209
209
  plugin_tree_version=""
210
210
 
211
- # Node cannot supervise its own stalled startup. Bash owns a live group anchor
212
- # and an independent builtin-read timer instead. The real child Bash has its own
213
- # $$, waits for group qualification before starting Node, and drains its OWN
214
- # group. No remembered PID receives a later external signal. Its live anchor
215
- # pins the group even after Node returns, until all descendants are terminated.
211
+ # Node cannot supervise its own stalled startup. A directly forked Bash job owns
212
+ # a live group anchor and an independent builtin-read timer. No second Bash is
213
+ # exec'd, so its BASH_ENV and native ps startup cannot precede that timer. The
214
+ # parent passes only its fresh live job identity through a private FIFO; the
215
+ # child qualifies that group before Node starts and drains its OWN group while
216
+ # its anchor still pins the identity. No later external numeric signal is used.
216
217
  # Only this optional subprocess is bounded; enforcement below is unchanged.
217
218
  run_optional_freshness() (
218
- command -v mkfifo >/dev/null 2>&1 && command -v ps >/dev/null 2>&1 || exit 1
219
- ps -o pid= -p "$$" >/dev/null 2>&1 || exit 1
219
+ command -v mkfifo >/dev/null 2>&1 || exit 1
220
220
  # Bash 3.2 unwinds function locals before EXIT on an explicit exit inside
221
221
  # command substitution. This function already isolates all state in a subshell.
222
222
  scratch="" anchor="" scratch_identity="" current_identity="" helper_status=1
@@ -227,6 +227,9 @@ run_optional_freshness() (
227
227
  scratch_identity="$(stat -f '%d:%i:%Lp' "$scratch" 2>/dev/null)" ||
228
228
  scratch_identity="$(stat -c '%d:%i:%a' "$scratch" 2>/dev/null)" || exit 1
229
229
  [ "${scratch_identity##*:}" = 700 ] || exit 1
230
+ # If the anchor is still set, send the private stop handshake and wait for it
231
+ # before closing descriptors. Remove scratch only while its captured identity
232
+ # and trusted parent still match, preserving replaced or unrelated resources.
230
233
  cleanup_diagnostic() {
231
234
  if [ -n "$anchor" ]; then
232
235
  printf 'stop\n' >&8
@@ -245,32 +248,38 @@ run_optional_freshness() (
245
248
  trap 'exit 1' HUP INT TERM
246
249
  mkfifo "$scratch/start" "$scratch/done" || exit 1
247
250
  exec 8<>"$scratch/start" 9<>"$scratch/done" || exit 1
248
- set -m
249
- /bin/bash -c '
250
- set +m
251
- scratch="$1"
252
- shift
253
- # This live anchor qualifies its own group before launching any Node work.
254
- # Native qualification must not race a separate parent/start countdown.
255
- [ "$(ps -o pgid= -p "$$" 2>/dev/null | tr -d " ")" = "$$" ] || exit 1
251
+ builtin set -m
252
+ (
253
+ # A fork inherits the parent's traps and $$ on Bash 3.2. Reset the traps,
254
+ # and never mistake inherited $$ for this fresh job's process-group identity.
255
+ builtin trap - EXIT HUP INT TERM
256
+ builtin set +m
257
+ builtin read -r -t 1 -u 8 admission || exit 1
258
+ case "$admission" in anchor:*) group="${admission#anchor:}" ;; *) exit 1 ;; esac
259
+ case "$group" in ''|*[!0-9]*|0*) exit 1 ;; esac
260
+ # Bash can continue after a setpgid failure. Job-table admission alone is
261
+ # insufficient: require the fresh group to exist before work or signaling.
262
+ builtin kill -0 -- -"$group" 2>/dev/null || exit 1
256
263
  (
257
264
  node "$@" </dev/null >"$scratch/output" 2>/dev/null
258
- printf "%s\n" "$?" >"$scratch/status"
259
- printf "done\n" >&9
265
+ builtin printf "%s\n" "$?" >"$scratch/status"
266
+ builtin printf "done\n" >&9
260
267
  ) &
261
268
  # Bash 3.2 accepts integer timeouts. One second leaves headroom beneath
262
269
  # the two-second diagnostic ceiling without delaying real enforcement.
263
- if read -r -t 1 -u 9 done && [ "$done" = done ]; then
264
- printf "complete\n" >"$scratch/complete"
265
- # Parent acceptance or its bounded absence both terminate the group.
266
- read -r -t 1 -u 8 stop || true
270
+ if builtin read -r -t 1 -u 9 done && [ "$done" = done ]; then
271
+ builtin printf "complete\n" >"$scratch/complete"
272
+ builtin read -r -t 1 -u 8 stop || true
267
273
  fi
268
- kill -KILL -- -"$$"
269
- ' lisa-freshness "$scratch" "$@" &
274
+ builtin kill -KILL -- -"$group"
275
+ ) &
270
276
  anchor=$!
271
- while [ ! -f "$scratch/status" ] && [ "$(jobs -pr)" = "$anchor" ]; do sleep 0.01; done
272
- printf 'stop\n' >&8
273
- wait "$anchor" 2>/dev/null || true
277
+ if [ "$(builtin jobs -pr)" = "$anchor" ]; then
278
+ # Preauthorize termination only after the helper finishes. This removes
279
+ # parent polling and external sleep startup without accepting partial facts.
280
+ builtin printf 'anchor:%s\nstop\n' "$anchor" >&8
281
+ fi
282
+ builtin wait "$anchor" 2>/dev/null || true
274
283
  anchor=""
275
284
  [ -f "$scratch/complete" ] && [ -f "$scratch/status" ] || exit 1
276
285
  read -r helper_status <"$scratch/status"
@@ -524,6 +533,8 @@ describe_host_guard() {
524
533
  esac
525
534
  }
526
535
 
536
+ # Choose apply repair only for demonstrated different guard bytes; otherwise
537
+ # request inspection without claiming uncertain host content is fresh.
527
538
  host_guard_repair() {
528
539
  if [ "${host_guard_states[$1]-unknown}" = different ]; then
529
540
  printf '%s' "$HOST_REPAIR"
@@ -88,10 +88,20 @@ function json(file, limit = METADATA_LIMIT) {
88
88
  }
89
89
  }
90
90
 
91
+ /**
92
+ * Accept only the bounded version syntax used by diagnostic facts.
93
+ * @param {unknown} value Untrusted metadata version to validate.
94
+ * @returns {string} Accepted version, or an empty string for unknown evidence.
95
+ */
91
96
  function version(value) {
92
97
  return typeof value === "string" && VERSION.test(value) ? value : "";
93
98
  }
94
99
 
100
+ /**
101
+ * Emit known facts as tab-delimited stdout rows, omitting empty unknown values.
102
+ * @param {string} key Diagnostic field selected by the caller.
103
+ * @param {string} value Validated fact, or an empty string when unavailable.
104
+ */
95
105
  function emit(key, value) {
96
106
  if (value) process.stdout.write(`${key}\t${value}\n`);
97
107
  }