opencove icon indicating copy to clipboard operation
opencove copied to clipboard

chore: add architecture harness baseline tooling

Open chen-985211 opened this issue 6 months ago • 1 comments

💡 Change Scope

  • [x] Small Change: Fast feedback, localized UI/logic, low-risk.
  • [ ] Large Change: New feature, cross-boundary logic, runtime-risk (persistence, IPC, lifecycle, recovery).

📝 What Does This PR Do?

Adds a dedicated project harness area and an architecture harness for executable architecture drift checks.

  • Adds harness/ with a root registry and aggregate harness commands.
  • Adds harness/architecture/ with the analyzer, rules, regression tests, staged doc-sync guard, and split baseline result files.
  • Adds manual commands: pnpm harness:check, pnpm harness:list, pnpm arch:audit, pnpm arch:check, pnpm arch:doc-sync, pnpm arch:results, and pnpm arch:test.
  • Documents the manual baseline phase, progressive repair workflow, architecture-doc sync process, and future CI promotion policy.
  • Keeps harness checks separate from product functional tests and Playwright E2E; this PR does not wire the harness into CI, pnpm pre-commit, or default product test discovery.

🏗️ Large Change Spec (Required if "Large Change" is checked)

Not applicable. This is internal harness/docs/tooling only and is not wired into runtime, persistence, IPC, CI, pnpm pre-commit, or product E2E.

1. Context & Business Logic

Not applicable for Large Change. The behavior introduced here is a manual architecture drift inspection workflow: compare actual source structure/import/API usage against documented architecture rules and record the current baseline for progressive repair.

2. State Ownership & Invariants

No product runtime state is introduced.

Invariants for the harness workflow:

  • Harness checks remain separate from product functional tests and E2E.
  • Architecture baseline result files are deterministic and split by rule so each file stays reviewable.
  • Architecture contract-document changes must either update executable rules/results/tests or be explicitly declared as no executable-rule impact.

3. Verification Plan & Regression Layer

Verification is locked at the tooling/unit layer:

  • harness/architecture/tests/architectureRules.spec.ts covers analyzer rule behavior.
  • pnpm harness:check covers architecture audit, doc-sync guard, and harness-specific tests.
  • Staged repository gates cover max lines, naming, secrets, formatting, and whitespace.

✅ Delivery & Compliance Checklist

  • [ ] My code passes the ultimate gatekeeper: pnpm pre-commit is completely green.
    • Not run because pnpm pre-commit includes E2E-related work; user explicitly requested full verification excluding E2E for this PR.
  • [x] I have signed the CLA if required (see CLA.md).
  • [x] I have included new tests to lock down the behavior (or explicitly stated why it's untestable).
  • [x] I have strictly adhered to the DEVELOPMENT.md architectural boundaries.
  • [x] I have attached a screenshot or screen recording (if this touches the UI).
    • Not applicable; this PR does not touch UI.
  • [x] I have updated the documentation accordingly (if adding a feature or changing a contract).

Verification run, excluding E2E by request:

  • pnpm line-check:staged
  • pnpm secret-check:staged
  • pnpm naming-check:staged
  • pnpm lint:fix
  • pnpm format-check:staged
  • pnpm check
  • pnpm test -- --run
  • pnpm harness:check
  • git diff --cached --check

E2E and pnpm pre-commit were intentionally not run for this PR per user request.

📸 Screenshots / Visual Evidence

Not applicable; no UI change.

chen-985211 avatar Jun 04 '26 07:06 chen-985211

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 04 '26 07:06 CLAassistant