Skip to content

Document bounded harness architecture#100

Merged
oshorefueled merged 36 commits into
mainfrom
codex/docs/harness-architecture-docs
Jul 24, 2026
Merged

Document bounded harness architecture#100
oshorefueled merged 36 commits into
mainfrom
codex/docs/harness-architecture-docs

Conversation

@oshorefueled

@oshorefueled oshorefueled commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Why

The docs still mixed current harness terminology with unreleased internal
agent-mode implementation history. That would teach future contributors the
wrong architecture, so the docs need to describe the bounded harness shipped by
this refactor.

What this PR covers

  • Documents VectorLint as a bounded content review harness with
    single/agent/auto model calls.
  • Updates README, Mintlify navigation, CLI reference, troubleshooting, scoring,
    and rule-authoring guidance to use current model-call language.
  • Commits root CONTEXT.md as the shared VectorLint domain language and
    updates AGENTS.md to reference it across code, docs, tests, and agent work.
  • Adds an AGENTS.md boundary rule that keeps audits, plans, specs, run notes,
    and similar coordination artifacts out of tracked product docs.
  • Removes tracked internal audit/run-note/spec artifacts from the product docs
    tree.

Scope

In scope

  • Documentation and root instruction files only.
  • Current CLI/docs language for --model-call single|agent|auto.
  • Historical framing for unreleased internal agent-mode implementation paths.
  • Domain-language and agent-instruction updates.
  • Removal of committed coordination artifacts from product docs.

Out of scope

  • Runtime code changes.
  • Test, build, or CI workflow changes.
  • New executor behavior.
  • Public transition promises for unreleased agent-mode paths.

Behavior impact

  • No runtime behavior changes.
  • Readers now see --model-call as the supported CLI surface.
  • Unreleased internal agent-mode references remain only as historical
    implementation context.
  • Raw audit, run-note, and spec artifacts are no longer tracked in product
    docs.

Code files checked for documentation claims

  • CLI flag/defaults: src/cli/commands.ts, src/cli/types.ts,
    src/schemas/cli-schemas.ts, src/boundaries/cli-parser.ts
  • Review contract: src/review/types.ts, src/review/schemas.ts,
    src/review/request-builder.ts
  • Model-call selection: src/review/executor.ts, src/executors/index.ts
  • Budgets: src/review/budget.ts
  • On-page boundary: src/review/boundary.ts,
    src/executors/target-read-capability-adapter.ts
  • Executors: src/executors/single-model-call-executor.ts,
    src/executors/agent-model-call-executor.ts
  • Finding processing: src/findings/processor.ts,
    src/findings/finding-evidence-verifier.ts, src/findings/scorer.ts,
    src/findings/types.ts
  • Provider capabilities: src/providers/structured-model-client.ts,
    src/providers/tool-calling-model-client.ts

Risk

  • Low. This is docs-only and does not intentionally change runtime behavior.
  • Main risk is stale or broken documentation links; Mintlify navigation slugs
    and targeted public-framing phrases were checked after the parent sync.

How to test / verify

Checks run

  • npm run verify
  • git diff --check origin/codex/docs/harness-architecture-docs...HEAD
  • docs/docs.json navigation slug check
  • Tracked artifact-boundary check for docs/audits/, docs/plans/,
    docs/specs/, docs/logs/, audits/, plans/, and specs/
  • Targeted grep audit for public-release or user-reliance framing

Manual verification

  • Confirmed the targeted grep audit returns no hits in README.md,
    AGENTS.md, CONTEXT.md, or docs/.
  • Confirmed product docs no longer link to docs/specs/, docs/audits/, or
    docs/logs/ coordination artifacts.
  • Confirmed parent branch codex/refactor/harness-executors-agent-removal
    was synced at 9c122f81ff2f60bbae4ad02dd861c705b0b82e17.

Rollback

  • Revert this docs-only branch if the documentation set needs to be restored
    before publishing a different harness architecture narrative.

Summary by CodeRabbit

  • Documentation
    • Repositioned VectorLint as a content review harness with structured findings and quality scores.
    • Added guidance on observable violation conditions and review strategies.
    • Expanded CLI reference documentation, including model-call options and output controls.
    • Added a dedicated Model Calls guide and updated documentation navigation.
    • Reworked the “How it works” and Quick Start content to explain the updated review pipeline and configuration.
    • Added a shared glossary covering review concepts, findings, scoring, and execution modes.

- Add npm run typecheck (tsc --noEmit) as the source-of-truth type gate
- Narrow exactOptionalPropertyTypes gaps via conditional spreads and
  optional-with-undefined fields across agent executor, orchestrator,
  observability, providers, and scorer
- Make CheckItem.line/description optional to match runtime reality
  (reported items carry optional fields; output formatters use a
  separate Issue type, so display is unaffected)
- Confine @ai-sdk/perplexity LanguageModelV1 -> LanguageModel skew to a
  single cast; ai@6 dropped V1 types and a provider upgrade is a
  separate, out-of-scope dependency change
- No strict compiler options relaxed; src/agent/* left compiling only
- Add docs/research/** to eslint ignores; the directory holds local,
  untracked throwaway research scripts that are not part of the shipped
  package and should not be type-checked by lint
- Project had no vitest config; vitest ran on pure defaults
- Pin test discovery to tests/**/*.test.ts and inline ora,
  @langfuse/otel, and @opentelemetry/sdk-node so suites that
  transitively import agent/observability modules resolve reliably
- No change to the 45 suites / 323 tests baseline
- Runs typecheck, lint, and test:run in sequence
- Single command for CI and downstream refactor phases to prove the
  verification baseline
- New typecheck.yml runs tsc --noEmit on push/PR for main and release-docs
- Bump test.yml from Node 18 to 20 to satisfy package.json engines>=20.6
- Catches type regressions in CI before merge, not just via ESLint
- README Agent Mode section replaced with under-review notice linking the audit
- --mode agent now warns through the injected logger and runs standard
  evaluation; the agent executor code is retained (unreachable from the CLI)
  pending Phase 4 removal
- Add logger to EvaluationOptions so the deprecation warning routes through the
  logging abstraction instead of console
- Rewrite orchestrator-agent-output tests to assert deprecation + fallback

BREAKING: --mode agent no longer runs the autonomous workspace-agent loop
- Record the shifted 2026-07-13 baseline: only tsc --noEmit was failing;
  lint and test:run were already green, so the audit's lint and four-suite
  module-resolution failures are stale
- Note the durable Phase 1 gates (typecheck, verify, vitest.config,
  docs/research lint exclusion, Node 20 typecheck/test workflows)
- Point to the --mode agent deprecation and standard fallback as the
  precondition for Phases 2-5; record that no spec or architecture doc is
  superseded in this appendix
- Commit a repository-native .vectorlint.ini using the bundled
  VectorLint preset (verbatim `vectorlint init` template).
- The required validation commands `npm start -- README.md --output line`
  and `npm start -- README.md --mode agent` previously failed from the
  committed branch with "Missing configuration file"; they had relied on
  an untracked, deleted VECTORLINT.md.
- Both smoke commands now run from a clean checkout with no untracked
  setup files; --mode agent still warns and falls back to standard mode.

Refs: .agent-runs/2026-07-13-223741-harness-refactor/reports/01-stop-the-bleeding.md
- Introduce src/review/ with typed + Zod-validated ReviewRequest/Result
  contracts, boundary helpers, budget defaults/enforcement, model-call
  selection, ReviewExecutor interface, and a PromptFile request builder
- Every external shape has a paired strict Zod schema; legacy scoring-mode,
  rubric, and model-authored rule-override fields are rejected
- modelCall is single | agent | auto; chooseModelCall() resolves auto
- On-page boundary (target + caller context only) via buildScope/isInScope
  with pure lexical URI normalization; no filesystem reads
- BudgetExceededError extends the repository VectorlintError base
- Purely additive: no changes outside src/review/ and tests/review/
- tests/review/ covers surface, schemas, budget, boundary, results,
  model-call selection, and the request builder (46 tests)
- Add src/findings/finding-evidence-verifier.ts wrapping locateQuotedText
  from src/output/location.ts as the single source of truth (audit #6).
- Anchored quotes return verified line/column/match; unanchored quotes
  return a finding-evidence-not-locatable warn diagnostic and no finding.
- Never falls back to a model-provided line number the way the old agent
  path did.
- Cover anchored, unanchored, no-line-hint, and truncation cases.
- Add src/findings/types.ts with the FindingProcessingInput contract and
  strict Zod schemas; no modelCall/mode/agent/evaluator/judge/rubric
  fields, so legacy judge/evaluator-shaped input is rejected.
- Add src/findings/severity.ts: resolveSeverity derives severity from the
  calculateCheckScore result (one path, no agent stamping); buildRuleId
  matches Pack.Rule[.Criterion] naming without importing src/agent/.
- Add src/findings/scorer.ts as a thin wrapper over calculateCheckScore;
  the verified finding count drives the score.
- Cover schema parse/reject, severity, rule-id, criterion resolution, and
  score numerics against calculateCheckScore.
- Add src/findings/processor.ts: processFindings runs the single pipeline
  (filter -> verify -> dedupe -> score -> severity -> diagnostics) and
  returns the Phase 2 ReviewResult from src/review/types.ts.
- Verified finding count, not raw candidate count, drives the score;
  unanchored evidence becomes a warn diagnostic and emits no finding;
  hadOperationalErrors is true only for error-level diagnostics.
- Add src/findings/index.ts barrel export.
- Golden processor test asserts findings/score match the standard check
  path; cover diagnostics, filtering, verified-count fix, dedupe, rule-id
  attribution, and ReviewResult contract validation.
- Build FindingProcessingInput and call processFindings in the standard
  objective-check branch of routePromptResult
- Feed returned findings/scores/diagnostics through the existing
  line/json/rdjson/vale sinks and quality-score output
- Remove inline filter/score/severity/quote-location logic from the check
  path; computeFilterDecision kept only for the debug-run artifact
- Verified finding count now drives counts and score (audit Finding #6);
  unanchored quotes become warn diagnostics and no longer flag operational
  errors
- Add orchestrator regression tests covering finding/score output,
  JSON/Vale shape, and exit behavior for supported objective-check reviews
- PROMPT_META_SCHEMA now rejects `type: judge` and its deprecated alias
  `subjective` via a superRefine, so judge-typed prompts fail to load with a
  descriptive warning instead of reaching evaluation.
- superRefine (not refine) keeps the inferred union including "judge" so the
  legacy BaseEvaluator type-checks unchanged until Phase 4 deletes that path.
- Add loader tests covering judge/subjective rejection and that check still
  loads; subjective and semi-objective are documented as deprecated aliases.
- Drop the judge branch of routePromptResult and the now-dead criterion
  extraction/reporting helpers (extractAndReportCriterion,
  validateCriteriaCompleteness, validateScores, locateAndReportViolations,
  buildRuleName); subjective rubric scoring is not a future-facing review type.
- A JudgeResult that still reaches the orchestrator is refused explicitly
  (operational error, no findings) rather than misprojected as a check result;
  no adapter is added for old judge metadata.
- Standard objective-check orchestration still routes through processFindings
  unchanged.
- Replace the judge-filtering orchestrator test with a judge-rejection test.
- Drop ProcessViolationsParams, ProcessCriterionParams,
  ProcessCriterionResult, and ValidationParams from src/cli/types.ts.
  They were orphaned when the orchestrator's inline violation/criterion
  processing moved to src/findings (Tasks 2-3) and the judge path was
  removed, and are referenced nowhere else.
- Remove the now-unused imports PromptMeta, PromptCriterionSpec,
  ScoreComponent, and JudgeResult. Severity and PromptEvaluationResult
  are retained (still used by ReportIssueParams / ProcessPromptResultParams).
- Add tests/findings/README.md mapping the behavior moved into src/findings
  (filtering, evidence verification, density scoring, rule-id/severity,
  formatter routing) and the intentionally removed judge/rubric and agent
  behavior, with agent tests marked out of scope for Phase 3 (Phase 3 Task 8).
- Stop describing type: judge/subjective as a valid future-facing prompt
  type in CREATING_RULES.md, docs/frontmatter-fields.mdx, and
  docs/style-guide.mdx; note that judge/subjective are now rejected at load.
- Drop the stale rubric-based scoring feature blurb from README.md.
- Map meta.criteria to { id, name } before processFindings so legacy
  PromptCriterionSpec rubric fields (weight, target) cannot cross the
  standard check orchestration -> findings contract
- Add tests/orchestrator-finding-criteria.test.ts mocking processFindings
  to assert weight/target are stripped on the production path
- prompt-loader criteria support is unchanged; criterion id/name still
  drive output rule-id attribution
- Add StructuredModelClient (runPromptStructured + LLMResult/TokenUsage) as
  the permanent single structured-output capability
- Add ToolCallingModelClient: bounded, executor-owned tool transport
  (runWithTools) that names no workspace/agent-finding concepts
- Make LLMProvider extend StructuredModelClient; keep runAgentToolLoop only
  as a temporary compile bridge for src/agent/ (deleted in a later task)
- VercelAIProvider implements both capabilities via a bounded runWithTools
  transport (caller-owned tools + caller-set step budget), no product loop
- Extend AIExecutionContext.operation with a transport-shaped 'tool-calling'
  label
- Add provider contract tests asserting the new surfaces and the absence of
  legacy workspace-agent concepts

Refs: docs/audits/2026-07-10-vectorlint-harness-architecture-audit.md
      (Finding #2; Product Decision)
- Add SingleModelCallExecutor behind the Phase 2 ReviewExecutor contract,
  reviewing source-backed rules with one structured model call per
  (rule, chunk) through an injected StructuredModelClient.
- Build rule prompts verbatim from request.rules[i].body; no tool surface
  and no reviewInstruction.
- Reuse buildCheckLLMSchema, RecursiveChunker, mergeViolations,
  prependLineNumbers, and processFindings instead of parallel projection.
- Enforce ReviewBudget.maxModelCallsPerReview via enforceBudget before each
  call; on exhaustion record an error diagnostic + hadOperationalErrors and
  return partial results rather than throwing past the contract.
- Record usage (modelCalls, wallClockMs always; input/output tokens gated on
  outputPolicy.includeUsage) consistent with ReviewResult.usage.
- Add focused tests: one call per rule, projected findings/scores/diagnostics,
  unanchored-evidence diagnostic, budget exhaustion, no tool calls, and
  large-target chunking/merging.
- Add AgentModelCallExecutor implementing ReviewExecutor via one bounded
  ToolCallingModelClient.runWithTools call per rule
- Expose exactly one executor-owned tool, read_target_section, through
  TargetReadCapability bound to in-memory request.target.content (no
  filesystem or non-target URI access)
- Map out-of-range/invalid ranges to model-visible error results so the
  bounded run continues instead of aborting
- Enforce ReviewBudget.maxModelCallsPerReview via enforceBudget before each
  run, surfacing exhaustion as an error diagnostic with partial results
- Pass request.rules[i].body verbatim as the source-backed prompt; no
  reviewInstruction is accepted or introduced
- Project results through src/findings/processor.ts so anchored findings,
  scores, and diagnostics match the shared pipeline
- Extract shared executor helpers (splitRuleId, buildEvalContext,
  buildReviewUsage, toFindingSeverity, budgetExceededDiagnostic,
  RunCounters) into src/executors/shared.ts and reuse from the single
  executor to remove duplication
- Add focused tests for the agent executor and target-read adapter
- Reject the removed --mode option without silently remapping it.\n- Cover single, agent, and auto executor dispatch plus ReviewResult routing.\n- Preserve the breaking CLI migration to --model-call single|agent|auto.
- create global config resources with restrictive permissions\n- propagate opt-in payload telemetry through both executors\n- cover CLI, package entrypoints, observability, and provider logging
- Keep observability operation types aligned with the executor-only review surface
- Replace stale agent-mode guidance with single/agent/auto model-call docs.

- Add the current harness architecture spec and migration guide.

- Commit shared domain language and update AGENTS.md for the review harness.
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@oshorefueled, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 8 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b8bcf660-8bd2-4773-a1ec-b32a753e6e88

📥 Commits

Reviewing files that changed from the base of the PR and between 8508c04 and f27b5b6.

📒 Files selected for processing (1)
  • README.md
📝 Walkthrough

Walkthrough

This documentation-focused change establishes shared VectorLint terminology, updates contributor guidance, reframes the README around content reviews, rewrites the review pipeline documentation, adds observable rule-writing guidance, and documents CLI model-call strategies.

Changes

VectorLint documentation

Layer / File(s) Summary
Terminology and documentation boundaries
AGENTS.md, CONTEXT.md
Adds shared domain vocabulary for reviews, rules, model calls, findings, scoring, and outputs, plus boundaries for documentation artifacts and internal terminology.
README positioning and review guidance
README.md
Reframes VectorLint as a content review harness and updates quality standards, findings, configuration, observability, and review-strategy guidance.
Review pipeline and rule-writing documentation
docs/how-it-works.mdx, docs/best-practices.mdx
Describes a five-step review pipeline and adds guidance for concrete, evidence-checkable violation conditions.
Model-call CLI reference
docs/cli-reference.mdx, docs/model-calls.mdx, docs/docs.json
Documents auto, single, and agent model-call strategies, expands CLI flag coverage, and adds the model-calls navigation route.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is substantive, but it omits the required Summary, Branch Target, and Verification sections from the template. Add the template sections with a concise summary, select the target branch checkbox, and include an explicit verification statement.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the docs-only bounded harness architecture framing change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/docs/harness-architecture-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

- AgentToolError's only consumers were src/agent/executor.ts,
  src/agent/path-utils.ts, and tests/agent/agent-executor.test.ts,
  all deleted with the autonomous workspace-agent surface
- Remove the now-unused class so no agent-tied symbol lingers in
  the error hierarchy

Refs: docs/audits/2026-07-10-vectorlint-harness-architecture-audit.md (Product Decision; Finding #2)
- Remove public migration and deprecation framing for unreleased agent-mode paths.

- Drop the migration page, navigation entry, and troubleshooting guidance that implied external users.

- Reword historical audit and architecture notes around internal implementation cleanup.
- Replace remaining public transition wording in the historical audit with internal removal language.

- Keep the audit historical while aligning it to unreleased agent-mode scope.
- Remove tracked audit, run-note, and spec artifacts from product docs.

- Replace product-doc links to the removed spec with current usage docs.

- Add AGENTS guidance that keeps coordination artifacts in ignored workspace state.
@oshorefueled
oshorefueled changed the base branch from codex/refactor/harness-executors-agent-removal to main July 24, 2026 05:46
- Preserve the bounded harness documentation and domain language.

- Accept the finalized evaluator removal and rule schema from main.

- Drop stale implementation-log and test-documentation artifacts.
- Restore main's review terminology and current project structure.

- Remove stale evaluator, rubric, and technical-accuracy concepts.

- Preserve the domain-language and documentation-boundary guidance.
- Define VectorLint through observable standards and measurable feedback
- Remove internal review contracts and processing details from user docs
- Add terminology boundaries for contributor and public documentation
- Use strategy consistently for model-call selection
- Simplify the rules resource label
@oshorefueled
oshorefueled marked this pull request as ready for review July 24, 2026 08:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 69-77: Update the credentials note in the README section around
the vectorlint review command to recognize both ~/.vectorlint/config.toml and a
local .env file as valid setup options, while preserving the existing reference
to Step 3.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b10015e3-9d7b-4cb8-aee5-02709bdb122e

📥 Commits

Reviewing files that changed from the base of the PR and between 8d950f6 and 8508c04.

📒 Files selected for processing (9)
  • AGENTS.md
  • CONTEXT.md
  • README.md
  • docs/best-practices.mdx
  • docs/cli-reference.mdx
  • docs/docs.json
  • docs/how-it-works.mdx
  • docs/logs/2026-03-31-agent-mode-implementation-plan.log.md
  • docs/model-calls.mdx
💤 Files with no reviewable changes (1)
  • docs/logs/2026-03-31-agent-mode-implementation-plan.log.md

Comment thread README.md Outdated
@oshorefueled

Copy link
Copy Markdown
Contributor Author

/check-docs

@bugsy-tr

bugsy-tr Bot commented Jul 24, 2026

Copy link
Copy Markdown

✅ No documentation drift detected... all good here!

Details

This PR contains no src/ changes — it is a documentation and contributor-guidance update. Changes include a rewritten README.md, a new docs/model-calls.mdx page, an expanded CLI reference flags table, a new CONTEXT.md domain language file, additions to AGENTS.md, and removal of an internal implementation log. Because no source code changed, no existing documentation is invalidated by this PR.

- Recognize both global config and local environment files in setup
@oshorefueled
oshorefueled merged commit aa6e792 into main Jul 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant