Skip to content

feat(harness): agent-facing context map + convention-enforcing git hooks #134

Description

@keli-wen

Feature Summary

Add a single contexts/CONTEXT_MAP.md navigation entry point and a set of convention-enforcing git hooks, so any agent or contributor follows QuantMind's conventions by default rather than by memory. As part of this, document the boundary between contexts/ (agent and team navigation) and docs/ (user-facing component catalog and guides) so the two are not conflated.

Motivation

contexts/ has grown a real structure (design/, dev/, usage/) but has no single index a reader loads first. The LLMQuant/llmquant-data-mono monorepo already uses a contexts/CONTEXT_MAP.md as the mandatory first read, and it scales well as a navigation root; QuantMind should adopt the same entry-point pattern.

Conventions today live as prose in the quantmind-dev skill and in contexts/dev/, but nothing enforces them. A recent commit landed on master with a non-English subject line (dcf724b) because an external .gitai commit-message generator produced it. Enforcement should be deterministic and tool-independent, not a function of which local tool an author happens to run.

This follows the "build for agents, not agents" principle: the harness makes the environment legible and self-correcting (an entry index plus deterministic gates), rather than embedding an agent to police contributions after the fact.

Deliverables

  • contexts/CONTEXT_MAP.md: a top-level navigation index over contexts/, modeled on the reference monorepo. AGENTS.md and CLAUDE.md instruct that any read or write under contexts/ starts by reading this map.
  • A commit-msg hook that rejects non-English subject lines (for example, any CJK characters) and non-conventional-commit prefixes, aligned with .claude/skills/quantmind-dev/references/commit.md.
  • Wiring of the new hook into the existing .pre-commit-config.yaml stages (which already run ruff on pre-commit and scripts/verify.sh on pre-push), so the enforcement path is the one contributors already have installed.
  • A short written boundary in CONTEXT_MAP.md (or a contexts/dev/ page): contexts/ owns design, decisions, and contributor navigation; docs/ owns the user-facing component catalog (docs/README.md) and usage guides (docs/library.md). This is a boundary statement, not a file move.

Acceptance Criteria

  • contexts/CONTEXT_MAP.md exists and links every current top-level area under contexts/.
  • AGENTS.md and CLAUDE.md point to CONTEXT_MAP.md as the first read for contexts/ work.
  • A commit-msg hook rejects a subject line containing CJK characters and a subject line without a conventional-commit prefix, with a clear failure message; both paths are covered by a test or a documented manual check.
  • The hook is registered in .pre-commit-config.yaml and runs through the standard install path.
  • The contexts/ versus docs/ boundary is written down where a new contributor or agent will find it.
  • scripts/verify.sh still passes.

Non-goals

  • Rewriting existing git history to fix past non-English commits. dcf724b stays in history; this is fixed forward by the hook only.
  • Building an agent that reads run logs or telemetry. This issue is harness and navigation, not an agent.
  • Removing or relocating docs/README.md or docs/library.md. They are load-bearing, referenced by AGENTS.md, CLAUDE.md, the quantmind-dev skill, and CONTRIBUTING.md; any future relocation is a separate coordinated change.
  • A hosted documentation site. Docs hosting is a separate future decision.

Related Work

  • Legacy-artifact cleanup (removing the quant-scholar auto-generated wiki/, docs/papers.md, docs/quant-scholar.json, their two cron workflows, docs/EMBEDDINGS.md, and the .gitai/ tool config) is a separate chore pull request and does not need an issue; it is the immediate cause that motivated the commit-msg hook here.
  • contexts/dev/labels.md and contexts/dev/github-writing.md define the label and writing conventions this issue's hook and map should stay consistent with.

Breaking Changes

  • This feature introduces breaking changes.
  • This feature is backward compatible.

Metadata

Metadata

Assignees

Labels

area: contextsRepository information routing and discovery under contexts/area: harnessContributor and agent controls, CI, hooks, skills, and rulesetstype: featureAdds a new capability or observable behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions