Skip to content

m12-pr13: /context Living Engineering Brain (19 files)#31

Open
BalaShankar9 wants to merge 1 commit into
m12-pr12-provider-failover-testfrom
m12-pr13-context-docs
Open

m12-pr13: /context Living Engineering Brain (19 files)#31
BalaShankar9 wants to merge 1 commit into
m12-pr12-provider-failover-testfrom
m12-pr13-context-docs

Conversation

@BalaShankar9

Copy link
Copy Markdown
Owner

Summary

/context/ Living Engineering Brain — 18 enterprise-grade markdown files (plus README index) that synthesize every concern in this codebase. Cross-references existing canonical sources (blueprint, ADRs, runbooks, repo memory) rather than duplicating them.

Doc PR — exempt from the ~600 LOC cap. Total ~7,500 LOC of markdown across 19 files.

Files

# File Concern
1 PROJECT_OVERVIEW What HireStack AI is, who it serves
2 ARCHITECTURE Component map, deployables, request lifecycle
3 FRONTEND Next.js app, routes, state, dynamic imports
4 BACKEND FastAPI app, route registry, services, middleware
5 DATABASE Postgres tables, RLS, partitions, migrations
6 API HTTP/SSE surface, contract types, idempotency
7 AUTH_SECURITY JWT, RLS, capability tokens, prompt injection
8 DEVOPS_INFRA Hosting, Docker, CI, deployment topology
9 AI Pipeline, agents, chains, model router, cost
10 TESTING Test pyramid, contracts, eval gates
11 PERFORMANCE Latency budgets, hot paths, caching
12 FILE_TREE Annotated repository map
13 BUSINESS_LOGIC Domain rules, invariants, lifecycle states
14 TECH_DEBT TD-1..TD-10 register synthesis
15 RELEASE_READINESS Pre-deploy gates, rollout discipline
16 CHANGELOG_INTELLIGENCE What shipped, when, why, links to PRs
17 KNOWN_ISSUES Open bugs, watch list (W1..W15), gotchas
18 SCALABILITY_ROADMAP Stage A/B/C plan, scaling triggers

Self-updating contract

  • scripts/governance/check_context_freshness.py — advisory script; reads each file's YAML front-matter watch_paths + last_synced, runs git log --since=<last_synced> -- <watch_paths>, warns if commits exist. Always exits 0. Wired as make check-context.
  • CONTRIBUTING.md gains a "Context system maintenance" section with a change-type → context-file map and a "what good /context maintenance looks like" checklist.
  • Promotion of check-context to a required CI gate is tracked as KNOWN_ISSUES.md W14 (gated on noise rate < 30% over a month).

Front-matter contract

Every file begins with:

---
title: <Concern>
last_synced: 2026-05-08
watch_paths: [...]
canonical_sources: [...]
update_when: [...]
---

Then: H1 + tagline blockquote, "TL;DR — N lines" numbered list, sections, ending with a "What good X looks like" checklist.

Stacked on

PR #30 (m12-pr12-provider-failover-test).

Verification

$ python scripts/governance/check_context_freshness.py
checking 18 context files for staleness...
... (advisory warnings expected — last_synced=today, recent commits exist)
exit=0

Adds context/ documentation system per MASTER PROMPT: 18 enterprise-grade
files (plus README index) documenting every concern in the application,
cross-referencing existing canonical sources (blueprint, ADRs, runbooks,
repo memory) rather than duplicating them.

Files: PROJECT_OVERVIEW, ARCHITECTURE, FILE_TREE, FRONTEND, BACKEND,
DATABASE, API, AUTH_SECURITY, AI, BUSINESS_LOGIC, DEVOPS_INFRA, TESTING,
PERFORMANCE, TECH_DEBT, RELEASE_READINESS, KNOWN_ISSUES,
SCALABILITY_ROADMAP, CHANGELOG_INTELLIGENCE.

Self-updating contract:
- scripts/governance/check_context_freshness.py (advisory, exit 0) wired
  as `make check-context`. Reads YAML front-matter watch_paths +
  last_synced and warns when watched paths have changed since the last
  sync date. Promotion to required gate tracked as KNOWN_ISSUES W14.
- CONTRIBUTING.md gains a "Context system maintenance" section with a
  change-type to context-file map.

Doc PR — exempt from the ~600 LOC cap; total ~7,500 LOC of markdown.
Stacked on PR #30 (m12-pr12-provider-failover-test).
Copilot AI review requested due to automatic review settings May 9, 2026 03:36

Copilot AI 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.

Pull request overview

Adds a new /context/ documentation system (“Living Engineering Brain”) plus a lightweight governance helper to detect when context docs may be stale relative to watched code paths.

Changes:

  • Introduces 18 concern-focused /context/*.md documents plus context/README.md index with shared YAML front-matter conventions.
  • Adds scripts/governance/check_context_freshness.py and wires it to make check-context.
  • Updates CONTRIBUTING.md with guidance on when/how to maintain /context.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
scripts/governance/check_context_freshness.py Adds advisory script to warn when watched paths changed since last_synced.
Makefile Adds check-context target to run the advisory freshness checker.
CONTRIBUTING.md Documents the /context maintenance workflow and update mapping.
context/README.md Adds /context index and conventions for the documentation system.
context/PROJECT_OVERVIEW.md High-level product/system overview context doc.
context/ARCHITECTURE.md Architecture map and rules cross-referencing canonical blueprint/ADRs.
context/FRONTEND_CONTEXT.md Frontend structure, SSE contract, and testing/deploy notes.
context/BACKEND_CONTEXT.md Backend processes, middleware order, routes/services/workflows overview.
context/DATABASE_CONTEXT.md DB/RLS/migration/partitioning discipline and key table inventory.
context/API_CONTEXT.md Public HTTP/SSE surface and contracts (OpenAPI, idempotency, events).
context/AUTH_SECURITY_CONTEXT.md Auth, RLS, SSRF, capability tokens, sandbox tiers, and security posture.
context/DEVOPS_INFRA_CONTEXT.md Deployment topology, CI gates, staging mirror, and infra conventions.
context/AI_CONTEXT.md AI engine boundaries, model routing, reliability primitives, tools/evals/observability.
context/TESTING_CONTEXT.md Test pyramid, required gates, and local/CI testing conventions.
context/PERFORMANCE_CONTEXT.md SLOs, latency/cost budgets, load testing, and perf guardrails.
context/BUSINESS_LOGIC_CONTEXT.md Domain rules, pipeline phases, and user-visible surfaces/invariants.
context/TECH_DEBT.md TD ledger synthesis with states, plans, and anchors.
context/RELEASE_READINESS.md Stage A readiness checklist and P0/P1 status summary.
context/CHANGELOG_INTELLIGENCE.md Engineering-facing changelog index tying PRs to memories/contexts/ADRs.
context/KNOWN_ISSUES.md Watch list (W-items) and risk matrix with defenses/triggers.
context/SCALABILITY_ROADMAP.md Stage A/B/C triggers and scaling plan.
context/FILE_TREE.md Annotated repository map and “where do I put this?” cheat sheet.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Tier-to-cell mapping is in blueprint §5.4.
8. Live URLs: <https://hirestack.tech> (frontend on Netlify) and
<https://hirestack-ai-production.up.railway.app> (backend on Railway).
E2E test user: `e2e-test@hirestack.local` / `E2ETestPass!2026`.
Comment on lines +17 to +18
CI integration: this runs informationally on every PR. It is NOT a
required gate. Promotion to required is tracked as KNOWN_ISSUES W14.
Comment thread context/README.md
Comment on lines +9 to +10
matching context file in the same PR. CI checks freshness via
`scripts/governance/check_context_freshness.py` (advisory, non-blocking).
Comment thread CONTRIBUTING.md
Comment on lines +197 to +201
| Change type | Update these files |
|---|---|
| New backend route | `API_CONTEXT.md` + `BACKEND_CONTEXT.md` + `AUTH_SECURITY_CONTEXT.md` (rate limit, scopes) |
| New frontend route or major component | `FRONTEND_CONTEXT.md` |
| New table or migration | `DATABASE_CONTEXT.md` (+ `AUTH_SECURITY_CONTEXT.md` if RLS pattern changes) |
Comment thread context/README.md
Comment on lines +33 to +36
| # | File | Concern | Watches |
|---|---|---|---|
| 1 | [PROJECT_OVERVIEW.md](PROJECT_OVERVIEW.md) | What HireStack AI is, who it serves, what it ships | `README.md`, `pyproject.toml`, `frontend/package.json` |
| 2 | [ARCHITECTURE.md](ARCHITECTURE.md) | Component map, deployables, request lifecycle | `docs/architecture/WORLD_CLASS_ARCHITECTURE_BLUEPRINT.md`, `docs/ARCHITECTURE.md` |
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