Skip to content

feat: architecture docs - #155

Merged
sergiofilhowz merged 1 commit into
mainfrom
feat/architecture-docs
May 18, 2026
Merged

feat: architecture docs#155
sergiofilhowz merged 1 commit into
mainfrom
feat/architecture-docs

Conversation

@sergiofilhowz

@sergiofilhowz sergiofilhowz commented May 18, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Documentation

    • Added comprehensive architecture documentation and worker reference guides covering system design, component responsibilities, configurations, state management, dependencies, triggers, and operational workflows for all harness-node workers and infrastructure.
  • Chores

    • Improved plan-mode system prompt with enhanced step-by-step guidance for investigation, capability assessment, and planning execution.

Review Change Stack

@vercel

vercel Bot commented May 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview, Comment May 18, 2026 8:05pm

Request Review

@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR expands documentation coverage for the harness-node system by publishing comprehensive architecture and per-worker documentation into the repository, enabling git tracking. It includes system design diagrams, worker interface catalogs, and a refinement to the agent's plan-mode system prompt.

Changes

Harness-Node Documentation and System Prompt

Layer / File(s) Summary
Documentation infrastructure and discovery
.gitignore, harness-node/README.md
Removes docs/ from gitignore to allow documentation to be tracked and version-controlled. README updated with a new docs/ entry pointing to architecture.md and per-worker guides.
Architecture overview and system design
harness-node/docs/architecture.md
Introduces the complete harness-node architecture including package/worker layout, a worker catalogue table, system diagram (Mermaid flowchart) showing worker interactions and data flow, turn FSM state machine diagram, approval flow sequence diagram, kernel deny list with security policy, shared runtime/types modules, boot ordering with dependency edges, and configuration behavior across URL/config flags and policy reloading.
Core/orchestration worker documentation
harness-node/docs/workers/harness.md, harness-node/docs/workers/hook-fanout.md, harness-node/docs/workers/session.md, harness-node/docs/workers/turn-orchestrator.md
Comprehensive guides for the harness glue layer, hook-fanout publish/collect primitive with merge rules and polling behavior, session storage backends (tree + inbox model), and turn orchestrator's durable FSM. Each documents registered functions, triggers/state keys, configuration options, dependencies, and source file layout.
Utility and governance worker documentation
harness-node/docs/workers/approval-gate.md, harness-node/docs/workers/auth-credentials.md, harness-node/docs/workers/context-compaction.md, harness-node/docs/workers/llm-budget.md, harness-node/docs/workers/models-catalog.md
Documentation for access control (approval-gate with fail-closed behavior), credential persistence and resolution, session history compaction with token-triggered summarization, LLM spend caps and forecasting, and model capability registry with state-first seeding.
Provider worker documentation
harness-node/docs/workers/provider-anthropic.md, harness-node/docs/workers/provider-openai.md
Guides for Anthropic Messages API and OpenAI Chat Completions streaming providers: SSE parsing and streaming flow, dual-function contracts (streaming + legacy drain-and-return), config defaults (max tokens, API URL), auth-credentials dependency, and module layout for streaming/parsing/wire translation.
Plan-mode system prompt improvement
harness-node/src/turn-orchestrator/system-prompt.ts
Replaces brief plan-mode instructions with detailed step-by-step requirements: investigate needed functions/skills via agent_call, clarify ambiguities with the user, and end with an actionable todo list instead of brief reasoning.

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly Related PRs

  • iii-hq/workers#151: Prior changes to system-prompt.ts in turn-orchestrator that inform context for the plan-mode text refinement.

Suggested Reviewers

  • andersonleal

Poem

🐰 Whiskers twitching with documentation glee,
Eleven workers now wear their stories with pride,
Architecture diagrams dance, FSMs glide,
The plan-mode hops deeper—step-by-step, you see,
Each worker a thread in the harness tapestry!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat: architecture docs' accurately describes the primary change: adding comprehensive architecture and worker documentation files throughout the project.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/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 and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 10 skipped (no docs/).

Layer Result
structure
vale
ai

Three for three. Nicely done.

@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 `@harness-node/docs/workers/context-compaction.md`:
- Line 17: The doc mixes British and American spellings—replace all British
variants with American ones: change "summarises" to "summarizes" and "summarise"
to "summarize" across the file (notably the occurrence at the sentence
containing "messages, summarises, the older prefix..." and the other instances
noted), ensure existing American usage like "SUMMARIZER" and "summarize.ts"
remains unchanged, and run a quick grep for "summaris" to catch any remaining
British forms and update them to the American spelling.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 81036e8f-c88e-4c13-9492-998e1d851015

📥 Commits

Reviewing files that changed from the base of the PR and between 07311d9 and 74d41b1.

📒 Files selected for processing (15)
  • .gitignore
  • harness-node/README.md
  • harness-node/docs/architecture.md
  • harness-node/docs/workers/approval-gate.md
  • harness-node/docs/workers/auth-credentials.md
  • harness-node/docs/workers/context-compaction.md
  • harness-node/docs/workers/harness.md
  • harness-node/docs/workers/hook-fanout.md
  • harness-node/docs/workers/llm-budget.md
  • harness-node/docs/workers/models-catalog.md
  • harness-node/docs/workers/provider-anthropic.md
  • harness-node/docs/workers/provider-openai.md
  • harness-node/docs/workers/session.md
  • harness-node/docs/workers/turn-orchestrator.md
  • harness-node/src/turn-orchestrator/system-prompt.ts
💤 Files with no reviewable changes (1)
  • .gitignore

cache_read`, excluding `cache_write`) crosses the configured threshold,
it acquires a per-session single-writer lease, asks `session-tree` for
the active path, splits off the last `COMPACT_KEEP_RECENT_TURNS`
messages, summarises the older prefix via the configured provider's

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Standardize spelling: use American English consistently.

The document mixes British English ("summarises", "summarise") with American English ("summarizer", "summarize"). Pick one variant and use it throughout—American English is more common in technical documentation.

📝 Suggested standardization

Change all occurrences to American spelling:

  • Line 17: "summarises" → "summarizes"
  • Line 60: "summarise" → "summarize"
  • Lines 80-81: Keep "SUMMARIZER" (already American)
  • Line 99: Keep "summarize.ts" (already American)

Also applies to: 60-60, 80-81, 99-99

🤖 Prompt for 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.

In `@harness-node/docs/workers/context-compaction.md` at line 17, The doc mixes
British and American spellings—replace all British variants with American ones:
change "summarises" to "summarizes" and "summarise" to "summarize" across the
file (notably the occurrence at the sentence containing "messages, summarises,
the older prefix..." and the other instances noted), ensure existing American
usage like "SUMMARIZER" and "summarize.ts" remains unchanged, and run a quick
grep for "summaris" to catch any remaining British forms and update them to the
American spelling.

@sergiofilhowz
sergiofilhowz merged commit fce3152 into main May 18, 2026
11 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