Skip to content

docs: document audit sink configuration#125

Draft
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/documentation-automation-system-ab98
Draft

docs: document audit sink configuration#125
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/documentation-automation-system-ab98

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 4, 2026

Description

Updates the README audit documentation so operator-facing guidance matches the current registry audit implementation.

  • Adds audit sink environment variables to the configuration table
  • Replaces the stale write-only stderr audit blurb with current registry-mediated audit coverage
  • Documents stderr, JSONL file, webhook, and OpenTelemetry sink behavior and best-effort delivery constraints

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other

Checklist

  • Tests pass
  • Typecheck passes

Verification note: attempted pnpm docs:check, but the automation image has neither pnpm nor node on PATH. Verified source-backed docs claims with targeted rg checks against src/config.ts, src/audit/*, and src/registry/index.ts, and verified the committed change set is docs-only with git show --stat --oneline HEAD.

Open in Web View Automation 

cursoragent and others added 2 commits May 4, 2026 16:06
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Findings:

  1. README.md now promises an "always enabled" stderr audit trail, but the implementation routes that sink through createLogger(), so it inherits LOG_LEVEL filtering. With LOG_LEVEL=warn, success audit events disappear; with LOG_LEVEL=error, even failed audit events disappear. That is a docs/runtime contract mismatch on a compliance-sensitive path.
  2. The branch is currently failing build-and-test because pnpm docs:check reports README.md is stale. Run \pnpm docs:generate` to refresh.On this repo,README.md` is a generated/validated surface, so the hand-edited doc change needs the generated refresh before it meets the documentation contract.

Open questions / assumptions:

  • I’m assuming Sunil’s architecture standards here mean keeping operator-facing docs aligned with the implemented contract and respecting repo-managed generated surfaces. I didn’t find other architecture-standard issues in this small diff.

Change summary:

  • The PR adds audit sink env-var docs and expands the audit logging section in README.md, plus records the docs-only automation run in tasks/todo.md.
Open in Web View Automation 

Sent by Cursor Automation: Sunil On Demand Architecture Review

Comment thread README.md
### Audit Logging

All write operations (`harness_create`, `harness_update`, `harness_delete`, `harness_execute`) emit structured audit log entries to stderr. Each entry includes the tool name, resource type, operation, identifiers, and timestamp. This provides an audit trail without requiring external logging infrastructure.
The registry emits a structured audit event for every registry-mediated Harness API call, including `list`, `get`, `create`, `update`, `delete`, and `execute` operations. This covers the generic API tools (`harness_list`, `harness_get`, `harness_create`, `harness_update`, `harness_delete`, `harness_execute`) and records both successful and failed calls.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This repo treats README.md as a generated/validated artifact via scripts/generate-docs.js, and CI is already failing pnpm docs:check on this branch with README.md is stale. Run pnpm docs:generate to refresh. Please regenerate the README before merge; otherwise the docs change doesn’t satisfy the repo’s source-of-truth workflow.

Comment thread README.md

| Sink | How to enable | Behavior |
| ---- | ------------- | -------- |
| Stderr | Always enabled | Writes each event through the server logger. Success events log at `info`; failed calls log at `warn`. |
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

StderrSink is registered unconditionally, but it writes through createLogger("audit"), so it is still gated by the global LOG_LEVEL. That means this "Always enabled" row overstates the current behavior: at LOG_LEVEL=warn successful audit events are suppressed, and at LOG_LEVEL=error even failed audit events are suppressed. The docs should mention the log-level dependency, or the sink should bypass normal logger filtering if an always-on audit trail is the intended standard.

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.

2 participants