Skip to content

Commit 8a2310a

Browse files
jeremyederAmbient Code Botclaude
authored
docs: audit and update CLAUDE.md + BOOKMARKS.md (#1292)
## Summary - **CLAUDE.md**: Add 3 missing components to Structure, 3 Makefile targets, strip stale test counts, establish convention authority hierarchy (CLAUDE.md wins over constitution for shared conventions) - **BOOKMARKS.md**: Add Governance section (constitutions + SDD preflight), ADR-0007, 3 component guides, OpenShift dev guide, 3 design docs - All 62 existing links verified — zero broken references ## Test plan - [ ] Verify all newly-added paths exist in the repo - [ ] Confirm BOOKMARKS.md TOC anchors resolve correctly - [ ] Review convention authority language for clarity 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added a Governance section linking constitutions and CI workflow * Declared CLAUDE/BOOKMARKS as convention authorities and updated precedence rules * Added an ADR for workspace-scoped feature-flag management * Converted many guide sections into table-based listings and added new component guides (ambient API, SDK, CLI, OpenWebUI) * Expanded design/planning docs for runtime registry, CLI runners, and status updates * Updated local development guidance for OpenShift and simplified pre-commit/test documentation * Bumped constitution metadata and added a v1.1.0 changelog <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Ambient Code Bot <bot@ambient-code.local> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5e5f584 commit 8a2310a

File tree

3 files changed

+109
-346
lines changed

3 files changed

+109
-346
lines changed

.specify/memory/constitution.md

Lines changed: 23 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
<!--
22
Sync Impact Report - Constitution Update
3-
Version: 1.0.0
4-
Last Updated: 2025-11-13
3+
Version: 1.1.0
4+
Last Updated: 2026-04-10
5+
6+
Changelog (v1.1.0):
7+
- CLAUDE.md + BOOKMARKS.md declared authoritative for project conventions
8+
- Removed duplicated Development Standards (Go, Frontend, Python, Naming) — now defers to CLAUDE.md/BOOKMARKS.md
9+
- Removed duplicated Pre-Deployment Validation commands — now defers to CLAUDE.md
10+
- Updated Governance/Compliance: removed "Constitution supersedes all" language
11+
- Added Authority section establishing CLAUDE.md precedence for shared conventions
12+
- Kept all 10 core principles, Production Requirements, and spec-kit governance
513
614
Changelog (v1.0.0):
715
- RATIFIED: Constitution officially ratified and adopted
@@ -68,30 +76,15 @@ All features MUST be built using Kubernetes primitives and patterns:
6876

6977
### II. Security & Multi-Tenancy First
7078

71-
Security and isolation MUST be embedded in every component:
72-
73-
- **Authentication**: All user-facing endpoints MUST use user tokens via `GetK8sClientsForRequest()`
74-
- **Authorization**: RBAC checks MUST be performed before resource access
75-
- **Token Security**: NEVER log tokens, API keys, or sensitive headers; use redaction in logs
76-
- **Multi-Tenancy**: Project-scoped namespaces with strict isolation
77-
- **Principle of Least Privilege**: Service accounts with minimal permissions
78-
- **Container Security**: SecurityContext with `AllowPrivilegeEscalation: false`, drop all capabilities
79-
- **No Fallback**: Backend service account ONLY for CR writes and token minting, never as fallback
79+
Security and isolation MUST be embedded in every component. User token auth, RBAC, token redaction, project-scoped isolation, least privilege, and container security hardening are all non-negotiable. See CLAUDE.md Critical Context and [Security Standards](.claude/context/security-standards.md) for implementation details.
8080

8181
**Rationale**: Security breaches and privilege escalation destroy trust. Multi-tenant isolation is non-negotiable for enterprise deployment.
8282

8383
### III. Type Safety & Error Handling (NON-NEGOTIABLE)
8484

85-
Production code MUST follow strict type safety and error handling rules:
86-
87-
- **No Panic**: FORBIDDEN in handlers, reconcilers, or any production path
88-
- **Explicit Errors**: Return `fmt.Errorf("context: %w", err)` with wrapped errors
89-
- **Type-Safe Unstructured**: Use `unstructured.Nested*` helpers, check `found` before using values
90-
- **Frontend Type Safety**: Zero `any` types without eslint-disable justification
91-
- **Structured Errors**: Log errors before returning with relevant context (namespace, resource name)
92-
- **Graceful Degradation**: `IsNotFound` during cleanup is not an error
85+
No panics, no `any` types, explicit error wrapping with context. See CLAUDE.md Critical Context and [Error Handling Patterns](.claude/patterns/error-handling.md) for implementation details.
9386

94-
**Rationale**: Runtime panics crash operator loops and kill services. Type assertions without checks cause nil pointer dereferences. Explicit error handling ensures debuggability and operational stability.
87+
**Rationale**: Runtime panics crash operator loops and kill services. Explicit error handling ensures debuggability and operational stability.
9588

9689
### IV. Test-Driven Development
9790

@@ -148,14 +141,7 @@ All components MUST support operational visibility:
148141

149142
### VII. Resource Lifecycle Management
150143

151-
Kubernetes resources MUST have proper lifecycle management:
152-
153-
- **OwnerReferences**: ALWAYS set on child resources (Jobs, Secrets, PVCs, Services)
154-
- **Controller References**: Use `Controller: true` for primary owner
155-
- **No BlockOwnerDeletion**: Causes permission issues in multi-tenant environments
156-
- **Idempotency**: Resource creation MUST check existence first
157-
- **Cleanup**: Rely on OwnerReferences for cascading deletes
158-
- **Goroutine Safety**: Exit monitoring goroutines when parent resource deleted
144+
All child resources MUST have OwnerReferences with cascading deletes. Idempotent creation, no BlockOwnerDeletion, goroutine cleanup on parent deletion. See CLAUDE.md Critical Context for the key rules.
159145

160146
**Rationale**: Resource leaks waste cluster capacity and cause outages. Proper lifecycle management ensures automatic cleanup and prevents orphaned resources.
161147

@@ -255,107 +241,12 @@ Each commit MUST be atomic, reviewable, and independently testable:
255241

256242
## Development Standards
257243

258-
### Go Code (Backend & Operator)
259-
260-
**Formatting**:
261-
262-
- Run `gofmt -w .` before committing
263-
- Use `golangci-lint run` for comprehensive linting
264-
- Run `go vet ./...` to detect suspicious constructs
265-
266-
**Error Handling**: See Principle III: Type Safety & Error Handling
267-
268-
**Kubernetes Client Patterns**:
269-
270-
- User operations: `GetK8sClientsForRequest(c)`
271-
- Service account: ONLY for CR writes and token minting
272-
- Status updates: Use `UpdateStatus` subresource
273-
- Watch loops: Reconnect on channel close with backoff
274-
275-
### Frontend Code (NextJS)
276-
277-
**UI Components**:
278-
279-
- Use Shadcn UI components from `@/components/ui/*`
280-
- Use `type` instead of `interface` for type definitions
281-
- All buttons MUST show loading states during async operations
282-
- All lists MUST have empty states
283-
284-
**Data Operations**:
285-
286-
- Use React Query hooks from `@/services/queries/*`
287-
- All mutations MUST invalidate relevant queries
288-
- No direct `fetch()` calls in components
289-
290-
**File Organization**:
291-
292-
- Colocate single-use components with pages
293-
- All routes MUST have `page.tsx`, `loading.tsx`, `error.tsx`
294-
- Components over 200 lines MUST be broken down
295-
296-
### Python Code (Runner)
297-
298-
**Environment**:
299-
300-
- ALWAYS use virtual environments (`python -m venv venv` or `uv venv`)
301-
- Prefer `uv` over `pip` for package management
302-
303-
**Formatting**:
304-
305-
- Use `black` with 88 character line length
306-
- Use `isort` with black profile
307-
- Run linters before committing
308-
309-
### Naming & Legacy Migration
310-
311-
**Legacy Naming (vteam)**:
312-
313-
The project was renamed from vTeam to Ambient Code Platform (ACP). Use "ACP" in all new code, docs, and UI text.
314-
315-
**DO NOT rename without explicit instruction**:
316-
317-
- Kubernetes API group: `vteam.ambient-code`
318-
- Custom Resource Definitions (CRD kinds)
319-
- Container image names: `vteam_frontend`, `vteam_backend`, etc.
320-
- Kubernetes resource names: deployments, services, routes
321-
- Environment variables referenced in deployment configs
322-
323-
These retain `vteam` for backward compatibility. Renaming requires coordinated migration across deployments and is only done when explicitly instructed.
324-
325-
## Deployment & Operations
326-
327-
### Pre-Deployment Validation
328-
329-
**Go Components**:
330-
331-
```bash
332-
gofmt -l .
333-
go vet ./...
334-
golangci-lint run
335-
make test
336-
```
337-
338-
**Frontend**:
339-
340-
```bash
341-
npm run lint
342-
npm run build # Must pass with 0 errors, 0 warnings
343-
```
344-
345-
**Container Security**:
346-
347-
- Set SecurityContext on all Job pods
348-
- Drop all capabilities by default
349-
- Use non-root users where possible
244+
Per-language conventions (Go formatting, frontend patterns, Python tooling), build commands, pre-deployment validation, and naming/legacy migration rules are maintained in [`/CLAUDE.md`](/CLAUDE.md) and [`/BOOKMARKS.md`](/BOOKMARKS.md). Those files are the authoritative source — do not duplicate them here.
350245

351246
### Production Requirements
352247

353-
**Security**: Apply Principle II security requirements. Additionally: Scan container images for vulnerabilities before deployment.
354-
355-
**Monitoring**: Implement Principle VI observability requirements in production environment. Additionally: Set up centralized logging and alerting infrastructure.
356-
357-
**Scaling**:
358-
248+
- Scan container images for vulnerabilities before deployment
249+
- Set up centralized logging and alerting infrastructure
359250
- Configure Horizontal Pod Autoscaling based on CPU/memory
360251
- Set appropriate resource requests and limits
361252
- Plan for job concurrency and queue management
@@ -378,20 +269,13 @@ npm run build # Must pass with 0 errors, 0 warnings
378269
- **MINOR**: New principle/section added or materially expanded guidance
379270
- **PATCH**: Clarifications, wording, typo fixes, non-semantic refinements
380271

381-
### Compliance
382-
383-
- All pull requests MUST verify constitution compliance
384-
- Pre-commit checklists MUST be followed for backend, frontend, and operator code
385-
- Complexity violations MUST be justified in implementation plans
386-
- Constitution supersedes all other practices and guidelines
272+
### Authority
387273

388-
### Development Guidance
274+
[`/CLAUDE.md`](/CLAUDE.md) and [`/BOOKMARKS.md`](/BOOKMARKS.md) are the authoritative source of project conventions. This constitution covers spec-kit-specific governance (principles, commit discipline, amendment process) and defers to those files for shared conventions. If they conflict, CLAUDE.md wins.
389275

390-
Runtime development guidance is maintained in:
276+
### Compliance
391277

392-
- `/CLAUDE.md` for Claude Code development
393-
- Component-specific README files
394-
- MkDocs documentation in `/docs`
278+
- All pull requests MUST verify constitution compliance for spec-kit-governed concerns
279+
- Complexity violations MUST be justified in implementation plans
395280

396-
**Version**: [CONSTITUTION_VERSION] | **Ratified**: [RATIFICATION_DATE] | **Last Amended**: [LAST_AMENDED_DATE]
397-
<!-- Example: Version: 2.1.1 | Ratified: 2025-06-13 | Last Amended: 2025-07-16 -->
281+
**Version**: 1.1.0 | **Ratified**: 2025-11-13 | **Last Amended**: 2026-04-10

0 commit comments

Comments
 (0)