Skip to content

docs: add ADRs, runbooks, API spec and agent guides for AI readiness - #166

Open
Raj Mhatre (raj-mhatre-de-da) wants to merge 1 commit into
mainfrom
docs/ai-readiness
Open

Raj Mhatre (raj-mhatre-de-da) wants to merge 1 commit into
mainfrom
docs/ai-readiness

Conversation

@raj-mhatre-de-da

Copy link
Copy Markdown

Summary

Documentation-only AI readiness pass for the code freeze. Before → after, from the gauge-repo audit in docs/engineering-best-practices-audit.md (rubric item-credit-v1):

Before (estimate, main has no audit) After (this PR)
Adjusted compliance ~30.6% 42.9% (16 Met, 10 Partial, 23 Gap, 0 N/A)
Critical gates RED RED (16 required CI, 24 integration tests, 40 scoped secrets)

This does not reach the 90% target and does not turn the gates GREEN. The remaining items need CI workflows, tooling, tests or code, which are deliberately left out during the freeze; they are listed as ordered recommendations in the audit.

Items changed

Item Status Evidence
1 Skills Met .agents/skills/heimdall-backend.md, heimdall-release.md (next to the existing UI skill)
2 AGENTS.md Met appended guide table, commands and conventions
3 ADRs Met docs/adr/0001–0003, written retroactively and labelled as such
4 Runbooks Met docs/runbooks/ (deploy and rollback, stuck/AWOL jobs, cluster health, schema deploy)
5 API contract Partial docs/openapi/heimdall.yaml covers all 21 routes; bodies are generic objects
7 Changelog Met CHANGELOG.md v1.8.4–v1.10.0 with migration notes
8 On-call Partial docs/oncall.md; paging and escalation contacts are TODO(owner)
32 Flaky policy Met documented in AGENTS.md and the backend skill
49 Agent manifest Partial .agents/pattern-agents.json with schema_version, github.repo, skills only

Existing files are unchanged apart from the two append-only exceptions: README.md (+4 lines) and AGENTS.md (+22 lines), 0 deletions. No Go, SQL, workflow, script or config file is touched.

N/A items

None. No item was marked N/A to raise the score.

Inferred values

  • ADR rationale that is not recorded in git history is marked inferred in each ADR.
  • Runbook defaults (stale_job 45 s, awol_timeout 3600 s, keepalive 5 s, shutdown 30 s) are read from cmd/heimdall/heimdall.go and the janitor tests.

Open questions

  • Which team owns heimdall and has write access (for a CODEOWNERS file; main + releases already sets require_code_owner_review)?
  • clickup_list_id, slack_channel, datadog.service (and aws[] if deployed to AWS) for .agents/pattern-agents.json.
  • Paging, dashboards and escalation contacts, and where Heimdall is deployed, for docs/oncall.md and docs/runbooks/deploy-and-rollback.md (TODO(owner) markers).

Workflow changes needed

None in this PR.

What has not run on GitHub

Nothing in this PR is executed by CI beyond the existing Build and Test job. The OpenAPI file was checked against the router routes by hand and parsed as YAML.

Deploy risk

None. Documentation and agent-config files only. docker-image.yml runs on merge to main and rebuilds the same image contents.

After merge

A repo admin should add a ruleset requiring the build check (item 16):

gh api -X POST repos/patterninc/heimdall/rulesets --input - <<'JSON'
{"name":"require-ci","target":"branch","enforcement":"active",
 "conditions":{"ref_name":{"include":["~DEFAULT_BRANCH"],"exclude":[]}},
 "rules":[{"type":"required_status_checks","parameters":{"strict_required_status_checks_policy":false,
   "required_status_checks":[{"context":"build","integration_id":15368}]}}]}
JSON

Follow-ups (after the freeze)

  1. Integration tests in CI with a Postgres service (item 24, gate).
  2. Put the DockerHub secrets in a protected GitHub environment (item 40, gate).
  3. CODEOWNERS, manifest values, on-call contacts (items 9, 49, 8).
  4. golangci-lint, gofmt check, PR-title check, license scan, dependency deny-list, coverage floor, benchmarks, smoke test.
  5. Existing issues found: docker-image.yml references steps.version.outputs.value but no step named version exists, so BUILD_VERSION is empty in published images; internal/pkg/object/command/starrocks/job_context.go is not gofmt-clean; pkg/plugin/runtime.go imports internal/pkg/aws.

A fuller version (CI workflows, lint config, Makefile, tests, benchmarks) is built and verified locally on a separate branch and can be proposed after the freeze.

🤖 Generated with Claude Code

Documentation only: three retroactive ADRs, four runbooks and an on-call playbook,
an OpenAPI description of the existing routes, a CHANGELOG, backend and release
agent skills, a partial .agents/pattern-agents.json and the gauge-repo audit.
README.md and AGENTS.md are append-only. No source, workflow, script or config changes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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