@opendesignai/harness 0.4.0-alpha.0 → 0.5.0-alpha.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
@@ -14,7 +14,7 @@ Machine-checked rules for OpenDesign repositories (od-platform, openmotion, open
14
14
 
15
15
  Existing debt is frozen in baselines (`oxlint-suppressions.json`, `.harness/size-baseline.json`); new violations fail, and baseline growth is limited to the [lint rule changes described in Versioning](#versioning). Duplicated code and unused files, exports and dependencies need no baseline: `clones` and `unused` compare a change with its base commit and fail on what it adds. Error messages are written for coding agents: what was violated, the correct way, and the legitimate exemption, plus a link to the rule's page.
16
16
 
17
- Status: alpha (0.4.0-alpha.0). Distributed through the public npm registry as `@opendesignai/harness` under the `alpha` dist-tag (npm organization `opendesignai`). 0.1.0-alpha.0 was published by hand; later versions are published by CI through npm trusted publishing (see [Versioning](#versioning)). How a repository adopts it: [docs/adopting.md](docs/adopting.md).
17
+ Status: alpha (0.5.0-alpha.0). Distributed through the public npm registry as `@opendesignai/harness` under the `alpha` dist-tag (npm organization `opendesignai`). 0.1.0-alpha.0 was published by hand; later versions are published by CI through npm trusted publishing (see [Versioning](#versioning)). How a repository adopts it: [docs/adopting.md](docs/adopting.md).
18
18
 
19
19
  ## Rules
20
20
 
@@ -40,7 +40,7 @@ Every rule is tested with ESLint's `RuleTester` and with the same cases run thro
40
40
 
41
41
  | Preset | Contents |
42
42
  | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
43
- | `presets/base.json` | the 11 base `od/*` rules (`od/no-cjk-literal` off for tests and fixtures); Oxlint's `correctness` category (eslint, typescript, unicorn, oxc, react plugins); `typescript/ban-ts-comment` (Oxlint defaults); `react/rules-of-hooks`; `react/exhaustive-deps`; `eslint-comments/no-restricted-disable` forbidding inline disables of `od/*`, `eslint-comments/*`, `rules-of-hooks` and `no-abusive-eslint-disable` (bare names cover any `<prefix>/` form), and disable comments that name no rule (through od-harness's wrapper of the eslint-comments plugin, see [adopting](docs/adopting.md#3-clean-up-what-cannot-be-baselined)); `unicorn/no-abusive-eslint-disable` as a native second guard against disable comments that name no rule; unused disable directives reported as errors; warnings fail the run (`denyWarnings`); the eight compiler correctness rules in `react-compiler` and three noisy `suspicious` compiler rules (`react/exhaustive-effect-dependencies`, `react/hooks`, and `react/memo-dependencies`) turned off |
43
+ | `presets/base.json` | the 11 base `od/*` rules (`od/no-cjk-literal` off for tests and fixtures); Oxlint's `correctness` category (eslint, typescript, unicorn, oxc, react plugins); `typescript/ban-ts-comment` (Oxlint defaults); `react/rules-of-hooks`; `react/exhaustive-deps`; `eslint-comments/no-restricted-disable` forbidding inline disables of `od/*`, `eslint-comments/*`, `rules-of-hooks` and `no-abusive-eslint-disable` (bare names cover any `<prefix>/` form), and disable comments that name no rule (through od-harness's wrapper of the eslint-comments plugin, see [adopting](docs/adopting.md#3-clean-up-what-cannot-be-baselined)); `unicorn/no-abusive-eslint-disable` also rejects disables without rule names; unused disable directives reported as errors; warnings fail the run (`denyWarnings`); `eslint/no-control-regex`, the eight compiler correctness rules in `react-compiler` and three noisy `suspicious` compiler rules (`react/exhaustive-effect-dependencies`, `react/hooks`, and `react/memo-dependencies`) turned off |
44
44
  | `presets/platform-boundary.json` | `od/no-product-literal`, `od/no-shell-imports-product` (inactive until the repository sets `shell` and `product`) |
45
45
  | `presets/product.json` | `od/no-product-literal`; product-package rules (published-imports-only, manifest checks) arrive with stage 2 |
46
46
  | `presets/react-compiler.json` | opt-in: nine React Compiler-derived rules (`react/refs`, `react/set-state-in-effect`, `react/immutability`, `react/preserve-manual-memoization`, `react/purity`, `react/use-memo`, `react/incompatible-library`, `react/static-components`, `react/unsupported-syntax`) as errors; extend it after `base` ([ADR 0002](docs/decisions/0002-react-compiler-rules.md)) |
@@ -92,6 +92,7 @@ od-harness comments --base <ref> report excess added comment lines as a not
92
92
  od-harness baseline move <from> <to> move baseline entries along with moved files
93
93
  od-harness init [--check] generate or check repository agent configuration
94
94
  od-harness doctor check the installed harness version and Codex hook trust
95
+ od-harness hooks report [--days N] [--format text|json] summarize local hook decisions
95
96
  od-harness verify [--quick | --ci --base <ref>] [--skip lint-scope] [--format text|json|github]
96
97
  od-harness --version print the version
97
98
  ```
@@ -132,7 +133,7 @@ This repository's own workflows are linted by `.github/workflows/workflow-lint.y
132
133
 
133
134
  ## Versioning
134
135
 
135
- - New rules, and changes that make a rule or a preset report more (for example putting the React Compiler rules back into `base`), only ship in minor or major versions (`0.x`: the second number). Patch versions fix false positives, messages and tooling, and may turn rules off. A patch that turns a rule off makes `oxlint` fail in a repository that baselined the rule ("There are suppressions that do not occur anymore") and turns that rule's disable comments into unused directives: the upgrade change runs `oxlint --prune-suppressions` and deletes those comments.
136
+ - New rules, and changes that make a rule or a preset report more (for example putting the React Compiler rules back into `base`), only ship in minor or major versions (`0.x`: the second number). Patch versions fix false positives, messages and tooling, and may turn rules off. When a patch reduces false positives or turns a rule off, existing suppressions can become stale and make `oxlint` fail ("There are suppressions that do not occur anymore"). Run `oxlint --prune-suppressions` in the upgrade change and delete any disable comments that become unused.
136
137
  - When an upgrade adds a rule or makes an existing rule report more, commit the suppressions for existing files with the upgrade (`oxlint --suppress-all` on an otherwise clean branch). A repository without `oxlint-suppressions.json` fixes the new violations because only the adoption change may create a baseline file. `od-harness ratchet` allows existing rule totals to grow only in an owner-reviewed `@opendesignai/harness` upgrade. A change to `.oxlintrc.json` alone can admit only new rule IDs that the owner-reviewed change turns on. See [the ratchet policy](docs/ratchet.md#why-a-config-or-version-change-admits-new-rule-ids).
137
138
  - The public API includes the package's export `.` (`dist/plugin.mjs`: the `od` plugin as the default export, `VERSION`, and the types `Plugin`, `PluginRule`, `RuleContextLike` and `RuleMeta`), `./config` (`OxlintConfig` and `presets`), `./hook`, `./report`, `presets/*`, and the `od-harness` command. Other files in `dist/` are internal: the presets load `dist/eslint-comments.mjs` by path, and it exports the plugin and nothing else. Changes after 0.2.0-alpha.0: `dist/eslint-comments.mjs` no longer exports `clampLoc`, `parseRustDirective` and `wrapRule`, and the package no longer ships the declaration files `dist/cli.d.mts` (which was empty) and `dist/eslint-comments.d.mts`. The export `.` is unchanged. The build checks the packed package with publint and attw (`esm-only` profile) and fails on any warning.
138
139
  - Oxlint and the optional peer `oxlint-tsgolint` are pinned exactly. Every PR that upgrades Oxlint must also upgrade `oxlint-tsgolint`. An Oxlint upgrade is its own release, after the conformance suite, `pnpm smoke` and `pnpm hit-compare` agree. [ADR 0001](docs/decisions/0001-oxlint.md)
@@ -14,4 +14,7 @@ function hookEnv() {
14
14
  stopBase: process.env["OD_HARNESS_BASE"]
15
15
  };
16
16
  }
17
- export { hookEnv as n, isGitHubActions as r, childEnv as t };
17
+ function hookLogMode() {
18
+ return process.env["OD_HARNESS_HOOK_LOG"];
19
+ }
20
+ export { isGitHubActions as i, hookEnv as n, hookLogMode as r, childEnv as t };