@cairnkeep/cli 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +45 -0
- package/CONTRIBUTING.md +49 -0
- package/LICENSE +201 -0
- package/README.md +149 -0
- package/SECURITY.md +37 -0
- package/bin/cairn +73 -0
- package/claude/agents/code-reviewer.md +174 -0
- package/claude/agents/security-investigator.md +112 -0
- package/claude/agents/security-target-selector.md +90 -0
- package/claude/agents/security-validator.md +97 -0
- package/claude/agents/wiki-ingester.md +108 -0
- package/claude/agents/wiki-lint-auditor.md +94 -0
- package/claude/agents/wiki-query-analyst.md +84 -0
- package/claude/commands/context-explore.md +40 -0
- package/claude/commands/graphify.md +150 -0
- package/claude/commands/memory-review.md +85 -0
- package/claude/commands/memory-sync.md +71 -0
- package/claude/commands/recall.md +32 -0
- package/claude/commands/remember.md +43 -0
- package/claude/commands/repo-review.md +191 -0
- package/claude/commands/security-audit.md +174 -0
- package/claude/commands/wiki-ingest.md +112 -0
- package/claude/commands/wiki-lint.md +86 -0
- package/claude/commands/wiki-query.md +92 -0
- package/claude/hooks/context-explore-pretask.sh +93 -0
- package/claude/hooks/memory-capture.sh +59 -0
- package/claude/hooks/memory-recall.sh +84 -0
- package/claude/hooks/memory-wakeup.sh +45 -0
- package/docs/building-an-overlay.md +117 -0
- package/docs/domain-knowledge.md +86 -0
- package/docs/git-providers.md +36 -0
- package/docs/operating.md +366 -0
- package/mcp-memory-server/dist/embeddings.js +122 -0
- package/mcp-memory-server/dist/explore-cache.js +97 -0
- package/mcp-memory-server/dist/index.js +1256 -0
- package/mcp-memory-server/package.json +36 -0
- package/opencode/agents/code-reviewer.md +173 -0
- package/opencode/agents/security-investigator.md +111 -0
- package/opencode/agents/security-target-selector.md +89 -0
- package/opencode/agents/security-validator.md +96 -0
- package/opencode/agents/wiki-ingester.md +107 -0
- package/opencode/agents/wiki-lint-auditor.md +93 -0
- package/opencode/agents/wiki-query-analyst.md +83 -0
- package/opencode/command/code-review.md +199 -0
- package/opencode/command/context-explore.md +42 -0
- package/opencode/command/graphify.md +153 -0
- package/opencode/command/memory-review.md +44 -0
- package/opencode/command/memory-sync.md +94 -0
- package/opencode/command/recall.md +38 -0
- package/opencode/command/remember.md +46 -0
- package/opencode/command/security-audit.md +80 -0
- package/opencode/command/wiki-ingest.md +55 -0
- package/opencode/command/wiki-lint.md +51 -0
- package/opencode/command/wiki-query.md +50 -0
- package/opencode/plugins/memory-capture.ts +188 -0
- package/opencode/plugins/memory-recall.ts +132 -0
- package/opencode/plugins/memory-wakeup.ts +102 -0
- package/opencode/templates/security-finding-register.yaml.template +51 -0
- package/opencode/templates/security-issue.md.template +43 -0
- package/opencode/templates/security-policy.md.template +29 -0
- package/opencode/templates/security-report.md.template +43 -0
- package/opencode/templates/wiki-contradictions.md.template +31 -0
- package/opencode/templates/wiki-index.md.template +40 -0
- package/opencode/templates/wiki-lint-report.md.template +38 -0
- package/opencode/templates/wiki-log.md.template +11 -0
- package/opencode/templates/wiki-policy.md.template +47 -0
- package/opencode/templates/wiki-query-answer.md.template +26 -0
- package/opencode/templates/wiki-source-summary.md.template +33 -0
- package/opencode/workflows/memory-review-workflow.md +66 -0
- package/opencode/workflows/security-audit-workflow.md +197 -0
- package/opencode/workflows/wiki-ingest-workflow.md +149 -0
- package/opencode/workflows/wiki-lint-workflow.md +128 -0
- package/opencode/workflows/wiki-query-workflow.md +122 -0
- package/package.json +56 -0
- package/scripts/bootstrap.sh +99 -0
- package/scripts/doctor.sh +91 -0
- package/scripts/install-audit-timer.sh +68 -0
- package/scripts/lib/assert-tool-event.mjs +50 -0
- package/scripts/memory-store.sh +71 -0
- package/scripts/memory-wiki-audit.sh +156 -0
- package/scripts/sync-claude-assets.sh +182 -0
- package/scripts/sync-opencode-explore-assets.sh +187 -0
- package/scripts/sync-opencode-graphify-assets.sh +152 -0
- package/scripts/sync-opencode-memory-assets.sh +160 -0
- package/scripts/sync-opencode-plugin-assets.sh +163 -0
- package/scripts/sync-opencode-security-assets.sh +195 -0
- package/scripts/sync-opencode-wiki-assets.sh +250 -0
- package/scripts/test-audit-timer.sh +29 -0
- package/scripts/test-bootstrap-untracked.sh +41 -0
- package/scripts/test-cli-dispatch.sh +21 -0
- package/scripts/test-doctor.sh +32 -0
- package/scripts/test-launcher-hooks.sh +66 -0
- package/scripts/test-memory-store.sh +44 -0
- package/scripts/test-remember-recall-assertions.sh +70 -0
- package/scripts/transcript-to-text.mjs +53 -0
- package/scripts/verify-docs-parity.sh +112 -0
- package/scripts/verify-explore-maturation.sh +288 -0
- package/scripts/verify-fastcontext-reliability.sh +624 -0
- package/scripts/verify-no-private-references.sh +145 -0
- package/scripts/verify-opencode-live-parity.sh +864 -0
- package/scripts/verify-routing-seam.sh +169 -0
- package/scripts/verify-token-savings-ab.sh +557 -0
- package/templates/PROJECT-INSTRUCTIONS.md.template +42 -0
- package/templates/alignment-gap-register.yaml.template +56 -0
- package/templates/alignment-policy.md.template +28 -0
- package/templates/alignment-pr-template.md.template +18 -0
- package/templates/alignment-report.md.template +56 -0
- package/templates/env.example.template +25 -0
- package/templates/graph-policy.md.template +37 -0
- package/templates/graphs-gitignore.template +3 -0
- package/templates/memory-wiki-audit.service.template +6 -0
- package/templates/memory-wiki-audit.timer.template +9 -0
- package/templates/memory.json.template +4 -0
- package/templates/planning-config.json.template +6 -0
- package/templates/project-brief.md.template +40 -0
- package/templates/security-finding-register.yaml.template +51 -0
- package/templates/security-issue.md.template +43 -0
- package/templates/security-policy.md.template +29 -0
- package/templates/security-report.md.template +43 -0
- package/templates/start-claude.sh.template +46 -0
- package/templates/start-opencode.sh.template +41 -0
- package/templates/structured-change-canvas.md.template +63 -0
- package/templates/wiki-contradictions.md.template +31 -0
- package/templates/wiki-index.md.template +40 -0
- package/templates/wiki-lint-report.md.template +38 -0
- package/templates/wiki-log.md.template +11 -0
- package/templates/wiki-policy.md.template +47 -0
- package/templates/wiki-query-answer.md.template +26 -0
- package/templates/wiki-source-summary.md.template +33 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
Describe the change and the problem it solves.
|
|
4
|
+
|
|
5
|
+
## Alignment Checklist
|
|
6
|
+
|
|
7
|
+
- [ ] I did not push this work directly to the default branch.
|
|
8
|
+
- [ ] I ran `/gsd-align-audit` for changes that affect code, docs, `AGENTS.md`, or durable behavior, or this PR does not need it.
|
|
9
|
+
- [ ] I ran `/security-audit` for attack-surface or security-sensitive changes, or this PR does not need it.
|
|
10
|
+
- [ ] I updated repo docs and `AGENTS.md` if behavior or operating guidance changed.
|
|
11
|
+
- [ ] I kept branch-local findings out of durable memory until merge.
|
|
12
|
+
- [ ] I linked the relevant gap IDs from `.planning/alignment/GAPS.yaml` when applicable.
|
|
13
|
+
- [ ] I linked the relevant accepted finding IDs from `.planning/security/FINDINGS.yaml` when applicable.
|
|
14
|
+
- [ ] I will run `/gsd-align-promote` after merge for accepted gaps that changed durable memory or project-doc retrieval.
|
|
15
|
+
|
|
16
|
+
## Verification
|
|
17
|
+
|
|
18
|
+
List the checks you ran.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Alignment Audit Report
|
|
2
|
+
|
|
3
|
+
- Project: REPLACE_WITH_PROJECT_NAME
|
|
4
|
+
- Audit scope: diff | full
|
|
5
|
+
- Base ref: REPLACE_WITH_BASE_REF
|
|
6
|
+
- Head ref: REPLACE_WITH_HEAD_REF
|
|
7
|
+
- Generated at: REPLACE_WITH_TIMESTAMP
|
|
8
|
+
- Generated by: gsd-align-audit
|
|
9
|
+
|
|
10
|
+
## Summary
|
|
11
|
+
|
|
12
|
+
- Total gaps: 0
|
|
13
|
+
- Blocker: 0
|
|
14
|
+
- High: 0
|
|
15
|
+
- Medium: 0
|
|
16
|
+
- Low: 0
|
|
17
|
+
|
|
18
|
+
## Findings
|
|
19
|
+
|
|
20
|
+
### Gap ID: GAP-0001
|
|
21
|
+
|
|
22
|
+
- Title: REPLACE_WITH_TITLE
|
|
23
|
+
- Kind: code_ahead_of_docs
|
|
24
|
+
- Severity: high
|
|
25
|
+
- Truth source: code
|
|
26
|
+
- Proposed resolution: docs_and_memory
|
|
27
|
+
|
|
28
|
+
#### Evidence
|
|
29
|
+
|
|
30
|
+
- Code:
|
|
31
|
+
- REPLACE_WITH_CODE_PATH
|
|
32
|
+
- Docs:
|
|
33
|
+
- REPLACE_WITH_DOC_PATH
|
|
34
|
+
- Memory:
|
|
35
|
+
- REPLACE_WITH_MEMORY_KEY
|
|
36
|
+
|
|
37
|
+
#### Why this matters
|
|
38
|
+
|
|
39
|
+
REPLACE_WITH_IMPACT
|
|
40
|
+
|
|
41
|
+
#### Recommended next step
|
|
42
|
+
|
|
43
|
+
REPLACE_WITH_NEXT_STEP
|
|
44
|
+
|
|
45
|
+
## Deferred Items
|
|
46
|
+
|
|
47
|
+
- None
|
|
48
|
+
|
|
49
|
+
## Human Decisions Needed
|
|
50
|
+
|
|
51
|
+
- None
|
|
52
|
+
|
|
53
|
+
## Promotion Guidance
|
|
54
|
+
|
|
55
|
+
- Write to durable memory only after merge or explicit acceptance.
|
|
56
|
+
- If docs changed on the accepted branch, sync the project AnythingLLM workspace after merge.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Cairnkeep repo-local environment. Copy to .ai/.env and edit.
|
|
2
|
+
#
|
|
3
|
+
# The memory server uses an OpenAI-compatible endpoint for memory extraction and
|
|
4
|
+
# embedding-ranked search. Leave these unset to run memory in substring-only mode.
|
|
5
|
+
#
|
|
6
|
+
# CAIRN_LLM_API_KEY=
|
|
7
|
+
# CAIRN_LLM_API_URL=https://api.openai.com/v1
|
|
8
|
+
# CAIRN_LLM_EXTRACTION_MODEL=gpt-4o-mini
|
|
9
|
+
# CAIRN_MEMORY_EMBEDDING_MODEL=text-embedding-3-small
|
|
10
|
+
#
|
|
11
|
+
# Git host for the collaboration commands (memory-sync, repo-review, security-audit).
|
|
12
|
+
# One of: github | gitlab | codeberg | forgejo | none. See docs/git-providers.md.
|
|
13
|
+
# CAIRN_GIT_PROVIDER=github
|
|
14
|
+
#
|
|
15
|
+
# The memory server runs over stdio by default. HTTP mode is opt-in and network
|
|
16
|
+
# facing, so it is guarded: setting MCP_HTTP_PORT REQUIRES a bearer token, or the
|
|
17
|
+
# server refuses to start. Clients must send `Authorization: Bearer <token>`.
|
|
18
|
+
# CAIRN_MEMORY_HTTP_TOKEN=change-me-to-a-long-random-secret
|
|
19
|
+
# MCP_HTTP_PORT=7801
|
|
20
|
+
# MCP_HTTP_HOST=127.0.0.1
|
|
21
|
+
# Optional: comma-separated browser origins allowed via CORS (default: none).
|
|
22
|
+
# CAIRN_MEMORY_HTTP_ALLOWED_ORIGINS=
|
|
23
|
+
# Optional: comma-separated allowed Host headers for DNS-rebinding protection
|
|
24
|
+
# (default: the bind host + localhost on the chosen port).
|
|
25
|
+
# CAIRN_MEMORY_HTTP_ALLOWED_HOSTS=
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Project Knowledge Graph Policy
|
|
2
|
+
|
|
3
|
+
This repository uses `.planning/graphs/` as an optional, local, machine-facing derived knowledge graph layer.
|
|
4
|
+
|
|
5
|
+
## Canonical Sources
|
|
6
|
+
|
|
7
|
+
- Raw repository docs, ADRs, tests, interfaces, config, and code remain the canonical sources of truth.
|
|
8
|
+
- The graph must never overrule the default-branch implementation or canonical repository documents.
|
|
9
|
+
- Treat graph edges as retrieval hints and structural compression, not as accepted decisions.
|
|
10
|
+
|
|
11
|
+
## Branch Rules
|
|
12
|
+
|
|
13
|
+
- Project: `REPLACE_WITH_PROJECT_NAME`
|
|
14
|
+
- Default branch: `REPLACE_WITH_DEFAULT_BRANCH`
|
|
15
|
+
- Rebuild graph artifacts on the same branch as the code or docs changes they depend on.
|
|
16
|
+
- Keep graph build outputs local by default. Share or force-add them only when a human explicitly wants the artifact reviewed.
|
|
17
|
+
|
|
18
|
+
## Provenance Rules
|
|
19
|
+
|
|
20
|
+
- `EXTRACTED` edges are structural facts emitted by deterministic parsing.
|
|
21
|
+
- `INFERRED` and `AMBIGUOUS` edges are assistant-facing hints until they are confirmed elsewhere.
|
|
22
|
+
- Promote accepted conclusions into repo docs, wiki pages, memory, or governance artifacts instead of treating the graph itself as durable truth.
|
|
23
|
+
- If a graph result conflicts with raw sources, trust the raw sources and rebuild or investigate the graph.
|
|
24
|
+
|
|
25
|
+
## Scope Rules
|
|
26
|
+
|
|
27
|
+
- Use the graph to compress dependency context for planning, exploration, and impact analysis.
|
|
28
|
+
- Do not use graph outputs as a human-facing substitute for the repo wiki.
|
|
29
|
+
- Do not commit graph build outputs by default; `.planning/graphs/.gitignore` keeps them local unless you intentionally override it.
|
|
30
|
+
|
|
31
|
+
## Maintenance
|
|
32
|
+
|
|
33
|
+
- Enable Graphify explicitly in `.planning/config.json`.
|
|
34
|
+
- Install it locally with `uv pip install graphifyy && graphify install` before first use.
|
|
35
|
+
- Use `/gsd-graphify build` to create or refresh the graph after meaningful topology or architecture-doc changes.
|
|
36
|
+
- Use `/gsd-graphify status`, `/gsd-graphify query <term>`, and `/gsd-graphify diff` to inspect freshness and focused subgraphs.
|
|
37
|
+
- Planner and query consumers should treat stale graphs as approximate context, not proof.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# REPLACE_WITH_PROJECT_NAME Project Brief
|
|
2
|
+
|
|
3
|
+
Fill this brief before running `/gsd-new-project --auto @.planning/PROJECT-BRIEF.md`.
|
|
4
|
+
|
|
5
|
+
## Problem
|
|
6
|
+
|
|
7
|
+
Describe the user or business problem this project solves.
|
|
8
|
+
|
|
9
|
+
## Outcomes
|
|
10
|
+
|
|
11
|
+
- Primary outcome:
|
|
12
|
+
- Secondary outcomes:
|
|
13
|
+
|
|
14
|
+
## Users And Stakeholders
|
|
15
|
+
|
|
16
|
+
- Primary users:
|
|
17
|
+
- Operators or maintainers:
|
|
18
|
+
- Reviewers or approvers:
|
|
19
|
+
|
|
20
|
+
## Constraints
|
|
21
|
+
|
|
22
|
+
- Technical constraints:
|
|
23
|
+
- Security or compliance constraints:
|
|
24
|
+
- Runtime or deployment constraints:
|
|
25
|
+
|
|
26
|
+
## Non-Goals
|
|
27
|
+
|
|
28
|
+
-
|
|
29
|
+
|
|
30
|
+
## Initial Architecture Expectations
|
|
31
|
+
|
|
32
|
+
-
|
|
33
|
+
|
|
34
|
+
## Acceptance Signals
|
|
35
|
+
|
|
36
|
+
-
|
|
37
|
+
|
|
38
|
+
## Source Material
|
|
39
|
+
|
|
40
|
+
- Link or reference the idea doc, PRD, standards, or notes that should inform `/gsd-new-project`.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
version: 1
|
|
2
|
+
project: REPLACE_WITH_PROJECT_NAME
|
|
3
|
+
default_branch: REPLACE_WITH_DEFAULT_BRANCH
|
|
4
|
+
last_security_audit:
|
|
5
|
+
at: null
|
|
6
|
+
branch: null
|
|
7
|
+
report: null
|
|
8
|
+
findings: []
|
|
9
|
+
|
|
10
|
+
# Finding entry shape:
|
|
11
|
+
# - id: SEC-0001
|
|
12
|
+
# title: Unsafe shell command composition in archive import helper
|
|
13
|
+
# kind: command_execution
|
|
14
|
+
# severity: high
|
|
15
|
+
# status: open
|
|
16
|
+
# confidence: confirmed
|
|
17
|
+
# opened_by: security-audit
|
|
18
|
+
# opened_at: 2026-04-17T18:00:00Z
|
|
19
|
+
# branch: feature/archive-import
|
|
20
|
+
# threat_model: authenticated HTTP request
|
|
21
|
+
# exploit_surface: POST /api/import
|
|
22
|
+
# selected_file: src/import.rs
|
|
23
|
+
# investigation_target: shell command construction for imported filenames
|
|
24
|
+
# evidence:
|
|
25
|
+
# files:
|
|
26
|
+
# - src/import.rs
|
|
27
|
+
# commands:
|
|
28
|
+
# - cargo test --test import
|
|
29
|
+
# inputs:
|
|
30
|
+
# - multipart upload filename payload
|
|
31
|
+
# reports:
|
|
32
|
+
# - .planning/security/VALIDATED/SEC-0001-unsafe-shell-command-composition.md
|
|
33
|
+
# duplication:
|
|
34
|
+
# duplicate_of: null
|
|
35
|
+
# related_ids: []
|
|
36
|
+
# validation:
|
|
37
|
+
# verdict: accepted
|
|
38
|
+
# report_path: .planning/security/VALIDATED/SEC-0001-unsafe-shell-command-composition.md
|
|
39
|
+
# validated_at: 2026-04-17T18:00:00Z
|
|
40
|
+
# rationale: Reachable from the standard import flow without repo-external assumptions.
|
|
41
|
+
# remediation:
|
|
42
|
+
# status: open
|
|
43
|
+
# fixed_in: null
|
|
44
|
+
# verified_at: null
|
|
45
|
+
# tracking:
|
|
46
|
+
# provider_issue:
|
|
47
|
+
# project: group/project
|
|
48
|
+
# iid: "123"
|
|
49
|
+
# web_url: https://git.example.com/group/project/issues/123
|
|
50
|
+
# confidential: true
|
|
51
|
+
# created_at: 2026-04-17T18:00:00Z
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Confidential Security Issue Draft
|
|
2
|
+
|
|
3
|
+
- Project: REPLACE_WITH_PROJECT_NAME
|
|
4
|
+
- Provider project: REPLACE_WITH_PROVIDER_PROJECT
|
|
5
|
+
- Finding ID: REPLACE_WITH_FINDING_ID
|
|
6
|
+
- Severity: REPLACE_WITH_SEVERITY
|
|
7
|
+
- Kind: REPLACE_WITH_KIND
|
|
8
|
+
- Selected file: REPLACE_WITH_SELECTED_FILE
|
|
9
|
+
- Investigation target: REPLACE_WITH_INVESTIGATION_TARGET
|
|
10
|
+
- Threat model: REPLACE_WITH_THREAT_MODEL
|
|
11
|
+
- Branch: REPLACE_WITH_BRANCH
|
|
12
|
+
- Generated at: REPLACE_WITH_TIMESTAMP
|
|
13
|
+
- Source command: /security-audit
|
|
14
|
+
- Source report: REPLACE_WITH_REPORT_PATH
|
|
15
|
+
|
|
16
|
+
## Summary
|
|
17
|
+
|
|
18
|
+
REPLACE_WITH_SUMMARY
|
|
19
|
+
|
|
20
|
+
## Reachability And Impact
|
|
21
|
+
|
|
22
|
+
REPLACE_WITH_REACHABILITY_AND_IMPACT
|
|
23
|
+
|
|
24
|
+
## Evidence
|
|
25
|
+
|
|
26
|
+
REPLACE_WITH_EVIDENCE
|
|
27
|
+
|
|
28
|
+
## Minimal Reproduction Or Exploit Sketch
|
|
29
|
+
|
|
30
|
+
REPLACE_WITH_REPRODUCTION
|
|
31
|
+
|
|
32
|
+
## Recommended Remediation
|
|
33
|
+
|
|
34
|
+
REPLACE_WITH_REMEDIATION
|
|
35
|
+
|
|
36
|
+
## Local Artifact References
|
|
37
|
+
|
|
38
|
+
- Validated report: REPLACE_WITH_VALIDATED_REPORT
|
|
39
|
+
- Audit report: REPLACE_WITH_AUDIT_REPORT
|
|
40
|
+
|
|
41
|
+
## Confidentiality Note
|
|
42
|
+
|
|
43
|
+
This issue was generated from a governed local security assessment and should remain confidential until remediation and disclosure decisions are made.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Security Assessment Policy
|
|
2
|
+
|
|
3
|
+
This repository uses the governed security-assessment workflow to hunt for realistic security issues without turning normal development into uncontrolled offensive automation.
|
|
4
|
+
|
|
5
|
+
## Branch Rules
|
|
6
|
+
|
|
7
|
+
- Default branch: `REPLACE_WITH_DEFAULT_BRANCH`
|
|
8
|
+
- Do not push feature work directly to `REPLACE_WITH_DEFAULT_BRANCH`.
|
|
9
|
+
- Use feature branches for remediation and keep candidate reports under `.planning/security/CANDIDATES/` until a finding is validated.
|
|
10
|
+
|
|
11
|
+
## Safety Rules
|
|
12
|
+
|
|
13
|
+
- Run `/security-audit` only against this repository, repo-owned local processes, local files, and localhost services launched from this repo.
|
|
14
|
+
- Do not target external hosts, staging, production, or third-party systems.
|
|
15
|
+
- Keep proofs local, minimal, and non-destructive.
|
|
16
|
+
- Do not attempt persistence, credential harvesting, lateral movement, or data exfiltration.
|
|
17
|
+
|
|
18
|
+
## Finding Lifecycle
|
|
19
|
+
|
|
20
|
+
- Open or refresh findings with `/security-audit`.
|
|
21
|
+
- Keep rejected or duplicate candidates in run history only; do not copy them into the canonical ledger.
|
|
22
|
+
- Only accepted findings belong in `.planning/security/FINDINGS.yaml` and `.planning/security/VALIDATED/`.
|
|
23
|
+
- Close or downgrade findings only after remediation or explicit acceptance on the default branch.
|
|
24
|
+
|
|
25
|
+
## Review Expectations
|
|
26
|
+
|
|
27
|
+
- Critical and high-severity accepted findings should block merge until triaged by a human.
|
|
28
|
+
- Treat the repo-local findings ledger as the shared state for severity, status, and remediation progress.
|
|
29
|
+
- If a run cannot prove reachability convincingly, prefer rejection over speculative acceptance.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Security Audit Report
|
|
2
|
+
|
|
3
|
+
- Project: REPLACE_WITH_PROJECT_NAME
|
|
4
|
+
- Audit scope: diff | full
|
|
5
|
+
- Base ref: REPLACE_WITH_BASE_REF
|
|
6
|
+
- Head ref: REPLACE_WITH_HEAD_REF
|
|
7
|
+
- Threat model: REPLACE_WITH_THREAT_MODEL
|
|
8
|
+
- Focus path: REPLACE_WITH_FOCUS_PATH
|
|
9
|
+
- Generated at: REPLACE_WITH_TIMESTAMP
|
|
10
|
+
- Generated by: security-audit
|
|
11
|
+
|
|
12
|
+
## Summary
|
|
13
|
+
|
|
14
|
+
- Accepted findings: 0
|
|
15
|
+
- Rejected candidates: 0
|
|
16
|
+
- Selected file: REPLACE_WITH_SELECTED_FILE
|
|
17
|
+
- Investigation target: REPLACE_WITH_INVESTIGATION_TARGET
|
|
18
|
+
|
|
19
|
+
## Accepted Findings
|
|
20
|
+
|
|
21
|
+
### SEC-0001
|
|
22
|
+
|
|
23
|
+
- Title: REPLACE_WITH_TITLE
|
|
24
|
+
- Kind: command_execution
|
|
25
|
+
- Severity: high
|
|
26
|
+
- Report: REPLACE_WITH_REPORT_PATH
|
|
27
|
+
|
|
28
|
+
#### Why this matters
|
|
29
|
+
|
|
30
|
+
REPLACE_WITH_IMPACT
|
|
31
|
+
|
|
32
|
+
#### Recommended next step
|
|
33
|
+
|
|
34
|
+
REPLACE_WITH_NEXT_STEP
|
|
35
|
+
|
|
36
|
+
## Rejected Candidates
|
|
37
|
+
|
|
38
|
+
- None
|
|
39
|
+
|
|
40
|
+
## Safety Notes
|
|
41
|
+
|
|
42
|
+
- This run was limited to repo-local analysis and locally launched services or local files.
|
|
43
|
+
- Proofs should stay minimal and non-destructive.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Cairnkeep launcher for Claude Code. Loads this repo's .ai/.env (if present),
|
|
3
|
+
# then launches Claude Code in the repo root. Keep provider/profile specifics in
|
|
4
|
+
# your own wrapper; this stays minimal and generic.
|
|
5
|
+
#
|
|
6
|
+
# Wrapper seams (all optional, all no-ops when absent):
|
|
7
|
+
# .ai/pre-launch.sh sourced after .env, before launch. May export env
|
|
8
|
+
# (e.g. a provider base URL) or abort the launch by
|
|
9
|
+
# returning / exiting non-zero.
|
|
10
|
+
# CAIRN_EXTRA_SETTINGS path to a settings JSON layered on top of the
|
|
11
|
+
# harness defaults (passed as --settings). Process env
|
|
12
|
+
# still wins over this file, so an inline value beats
|
|
13
|
+
# the profile.
|
|
14
|
+
# .ai/post-exit.sh sourced after the harness exits (normal or not),
|
|
15
|
+
# with $CAIRN_EXIT_STATUS set to the harness exit code.
|
|
16
|
+
set -euo pipefail
|
|
17
|
+
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
|
18
|
+
if [[ -f "$ROOT_DIR/.ai/.env" ]]; then
|
|
19
|
+
set -a
|
|
20
|
+
# shellcheck disable=SC1091
|
|
21
|
+
. "$ROOT_DIR/.ai/.env"
|
|
22
|
+
set +a
|
|
23
|
+
fi
|
|
24
|
+
if [[ -f "$ROOT_DIR/.ai/pre-launch.sh" ]]; then
|
|
25
|
+
# shellcheck disable=SC1091
|
|
26
|
+
. "$ROOT_DIR/.ai/pre-launch.sh"
|
|
27
|
+
fi
|
|
28
|
+
cd "$ROOT_DIR"
|
|
29
|
+
|
|
30
|
+
launch_args=()
|
|
31
|
+
if [[ -n "${CAIRN_EXTRA_SETTINGS:-}" ]]; then
|
|
32
|
+
launch_args+=(--settings "$CAIRN_EXTRA_SETTINGS")
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
if [[ -f "$ROOT_DIR/.ai/post-exit.sh" ]]; then
|
|
36
|
+
# Run (not exec) so the post-exit hook fires after the harness returns.
|
|
37
|
+
set +e
|
|
38
|
+
claude "${launch_args[@]}" "$@"
|
|
39
|
+
CAIRN_EXIT_STATUS=$?
|
|
40
|
+
set -e
|
|
41
|
+
export CAIRN_EXIT_STATUS
|
|
42
|
+
# shellcheck disable=SC1091
|
|
43
|
+
. "$ROOT_DIR/.ai/post-exit.sh" || true
|
|
44
|
+
exit "$CAIRN_EXIT_STATUS"
|
|
45
|
+
fi
|
|
46
|
+
exec claude "${launch_args[@]}" "$@"
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Cairnkeep launcher for OpenCode. Loads this repo's .ai/.env (if present), then
|
|
3
|
+
# launches OpenCode in the repo root. Keep provider/profile specifics in your own
|
|
4
|
+
# wrapper; this stays minimal and generic.
|
|
5
|
+
#
|
|
6
|
+
# Wrapper seams (all optional, all no-ops when absent):
|
|
7
|
+
# .ai/pre-launch.sh sourced after .env, before launch. May export env
|
|
8
|
+
# or abort the launch by returning / exiting non-zero.
|
|
9
|
+
# CAIRN_EXTRA_SETTINGS path to an OpenCode config file layered via --config.
|
|
10
|
+
# .ai/post-exit.sh sourced after OpenCode exits, with $CAIRN_EXIT_STATUS
|
|
11
|
+
# set to the exit code.
|
|
12
|
+
set -euo pipefail
|
|
13
|
+
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
|
14
|
+
if [[ -f "$ROOT_DIR/.ai/.env" ]]; then
|
|
15
|
+
set -a
|
|
16
|
+
# shellcheck disable=SC1091
|
|
17
|
+
. "$ROOT_DIR/.ai/.env"
|
|
18
|
+
set +a
|
|
19
|
+
fi
|
|
20
|
+
if [[ -f "$ROOT_DIR/.ai/pre-launch.sh" ]]; then
|
|
21
|
+
# shellcheck disable=SC1091
|
|
22
|
+
. "$ROOT_DIR/.ai/pre-launch.sh"
|
|
23
|
+
fi
|
|
24
|
+
cd "$ROOT_DIR"
|
|
25
|
+
|
|
26
|
+
launch_args=()
|
|
27
|
+
if [[ -n "${CAIRN_EXTRA_SETTINGS:-}" ]]; then
|
|
28
|
+
launch_args+=(--config "$CAIRN_EXTRA_SETTINGS")
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
if [[ -f "$ROOT_DIR/.ai/post-exit.sh" ]]; then
|
|
32
|
+
set +e
|
|
33
|
+
opencode "${launch_args[@]}" "$@"
|
|
34
|
+
CAIRN_EXIT_STATUS=$?
|
|
35
|
+
set -e
|
|
36
|
+
export CAIRN_EXIT_STATUS
|
|
37
|
+
# shellcheck disable=SC1091
|
|
38
|
+
. "$ROOT_DIR/.ai/post-exit.sh" || true
|
|
39
|
+
exit "$CAIRN_EXIT_STATUS"
|
|
40
|
+
fi
|
|
41
|
+
exec opencode "${launch_args[@]}" "$@"
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Structured Change Canvas
|
|
2
|
+
|
|
3
|
+
Use this file as a starter for non-trivial changes that should be reviewed at the intent level before code is generated or edited.
|
|
4
|
+
|
|
5
|
+
- Project: REPLACE_WITH_PROJECT_NAME
|
|
6
|
+
- Base branch: REPLACE_WITH_DEFAULT_BRANCH
|
|
7
|
+
- Change slug: <short-change-slug>
|
|
8
|
+
- Status: draft
|
|
9
|
+
- Owner: <name>
|
|
10
|
+
- Related issue / branch / prompt: <link-or-id>
|
|
11
|
+
|
|
12
|
+
## Requirements
|
|
13
|
+
|
|
14
|
+
- Problem to solve:
|
|
15
|
+
- In scope:
|
|
16
|
+
- Out of scope:
|
|
17
|
+
- Done when:
|
|
18
|
+
|
|
19
|
+
## Entities
|
|
20
|
+
|
|
21
|
+
- Domain concepts and relationships:
|
|
22
|
+
- Existing interfaces, data contracts, or policies involved:
|
|
23
|
+
- External systems or dependencies touched:
|
|
24
|
+
|
|
25
|
+
## Approach
|
|
26
|
+
|
|
27
|
+
- Chosen implementation approach:
|
|
28
|
+
- Alternatives rejected:
|
|
29
|
+
- Key assumptions and risks:
|
|
30
|
+
|
|
31
|
+
## Structure
|
|
32
|
+
|
|
33
|
+
- Expected files, modules, or subsystems to change:
|
|
34
|
+
- Integration boundaries that must stay stable:
|
|
35
|
+
- Migration or rollback considerations:
|
|
36
|
+
|
|
37
|
+
## Operations
|
|
38
|
+
|
|
39
|
+
1. First implementation step:
|
|
40
|
+
2. Next implementation step:
|
|
41
|
+
3. Validation or rollout step:
|
|
42
|
+
|
|
43
|
+
## Norms
|
|
44
|
+
|
|
45
|
+
- Engineering rules that apply to this slice:
|
|
46
|
+
- Required tests or checks:
|
|
47
|
+
- Required docs, wiki, or memory updates:
|
|
48
|
+
|
|
49
|
+
## Safeguards
|
|
50
|
+
|
|
51
|
+
- Security or privacy constraints:
|
|
52
|
+
- Performance or reliability limits:
|
|
53
|
+
- Explicit no-go changes:
|
|
54
|
+
|
|
55
|
+
## Validation
|
|
56
|
+
|
|
57
|
+
- Commands to run:
|
|
58
|
+
- Evidence expected when the slice is correct:
|
|
59
|
+
|
|
60
|
+
## Sync Rules
|
|
61
|
+
|
|
62
|
+
- If requirements change, update this canvas before updating code.
|
|
63
|
+
- If implementation changes for a valid reason, sync this canvas before merging.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Wiki Contradiction Register
|
|
2
|
+
|
|
3
|
+
> Persistent register of contradictions flagged across `.planning/wiki/`.
|
|
4
|
+
> Updated in place by `/wiki-lint`. Unlike per-run REPORTS, this file is the
|
|
5
|
+
> durable record — lint opens and resolves entries here rather than emitting
|
|
6
|
+
> write-and-forget reports. Raw repo docs, tests, interfaces, config, and code
|
|
7
|
+
> remain canonical; this register only tracks where the *derived* wiki disagrees.
|
|
8
|
+
|
|
9
|
+
## Severity Taxonomy
|
|
10
|
+
|
|
11
|
+
- **soft** — non-blocking, contextual difference. Pages can coexist; flagged for awareness. No action required unless it accumulates.
|
|
12
|
+
- **scope-mismatch** — the two claims apply to different scopes/contexts and do not truly conflict. Recorded so a future reader is not confused; coexists.
|
|
13
|
+
- **hard** — genuinely conflicting claims that cannot both be correct. Must be resolved before downstream work relies on either page. Surface at session start.
|
|
14
|
+
|
|
15
|
+
## How To Use
|
|
16
|
+
|
|
17
|
+
- `/wiki-lint` writes/updates entries here on every run. Do not delete open entries by hand — resolve the underlying page disagreement, then let lint (or a `/wiki-ingest --refresh`) flip the status to `resolved`.
|
|
18
|
+
- At session start, scan the **Open** section for `severity: hard`. Surface any hard/open items before doing work that depends on the affected pages.
|
|
19
|
+
- An entry is `resolved` only after the conflicting wiki page(s) have actually been reconciled to the canonical source — not merely acknowledged.
|
|
20
|
+
|
|
21
|
+
## Open
|
|
22
|
+
|
|
23
|
+
<!-- wiki:contradictions:open:start -->
|
|
24
|
+
- None.
|
|
25
|
+
<!-- wiki:contradictions:open:end -->
|
|
26
|
+
|
|
27
|
+
## Resolved
|
|
28
|
+
|
|
29
|
+
<!-- wiki:contradictions:resolved:start -->
|
|
30
|
+
- None.
|
|
31
|
+
<!-- wiki:contradictions:resolved:end -->
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# REPLACE_WITH_PROJECT_NAME Knowledge Wiki
|
|
2
|
+
|
|
3
|
+
> Derived, sparse, citation-heavy notes for faster repository understanding.
|
|
4
|
+
> Canonical truth remains in raw repository docs, tests, interfaces, config, and code.
|
|
5
|
+
|
|
6
|
+
## How To Use This Wiki
|
|
7
|
+
|
|
8
|
+
- Start here to find source summaries, optional topic and entity pages, reusable query answers, and lint reports.
|
|
9
|
+
- Follow the cited canonical sources before treating any derived claim as settled.
|
|
10
|
+
- If the wiki conflicts with raw sources, trust the raw sources and note the contradiction.
|
|
11
|
+
|
|
12
|
+
## Sources
|
|
13
|
+
|
|
14
|
+
<!-- wiki:sources:start -->
|
|
15
|
+
- None yet.
|
|
16
|
+
<!-- wiki:sources:end -->
|
|
17
|
+
|
|
18
|
+
## Topics
|
|
19
|
+
|
|
20
|
+
<!-- wiki:topics:start -->
|
|
21
|
+
- None yet.
|
|
22
|
+
<!-- wiki:topics:end -->
|
|
23
|
+
|
|
24
|
+
## Entities
|
|
25
|
+
|
|
26
|
+
<!-- wiki:entities:start -->
|
|
27
|
+
- None yet.
|
|
28
|
+
<!-- wiki:entities:end -->
|
|
29
|
+
|
|
30
|
+
## Queries
|
|
31
|
+
|
|
32
|
+
<!-- wiki:queries:start -->
|
|
33
|
+
- None yet.
|
|
34
|
+
<!-- wiki:queries:end -->
|
|
35
|
+
|
|
36
|
+
## Reports
|
|
37
|
+
|
|
38
|
+
<!-- wiki:reports:start -->
|
|
39
|
+
- None yet.
|
|
40
|
+
<!-- wiki:reports:end -->
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Wiki Lint Report
|
|
2
|
+
|
|
3
|
+
- Project: REPLACE_WITH_PROJECT_NAME
|
|
4
|
+
- Generated at: REPLACE_WITH_TIMESTAMP
|
|
5
|
+
- Scope: REPLACE_WITH_SCOPE
|
|
6
|
+
- Advisory status: Raw repository docs, tests, interfaces, config, and code remain canonical.
|
|
7
|
+
|
|
8
|
+
## Summary
|
|
9
|
+
|
|
10
|
+
- Missing citations: 0
|
|
11
|
+
- Orphan pages: 0
|
|
12
|
+
- Stale claims: 0
|
|
13
|
+
- Contradicted claims: 0 (hard: 0 / scope-mismatch: 0 / soft: 0)
|
|
14
|
+
- Missing obvious pages: 0
|
|
15
|
+
- Broken cross-references: 0
|
|
16
|
+
|
|
17
|
+
> Contradiction entries are also written to `.planning/wiki/CONTRADICTIONS.md`,
|
|
18
|
+
> the persistent register. This report is a snapshot; the register is durable.
|
|
19
|
+
|
|
20
|
+
## Contradictions (severity-tagged)
|
|
21
|
+
|
|
22
|
+
- None.
|
|
23
|
+
|
|
24
|
+
## High Signal Findings
|
|
25
|
+
|
|
26
|
+
- None.
|
|
27
|
+
|
|
28
|
+
## Medium Signal Findings
|
|
29
|
+
|
|
30
|
+
- None.
|
|
31
|
+
|
|
32
|
+
## Low Signal Findings
|
|
33
|
+
|
|
34
|
+
- None.
|
|
35
|
+
|
|
36
|
+
## Suggested Next Steps
|
|
37
|
+
|
|
38
|
+
- Keep the wiki sparse, citation-heavy, and aligned to canonical raw sources.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Wiki Log
|
|
2
|
+
|
|
3
|
+
This log records wiki ingests, reusable query writebacks, and advisory lint runs.
|
|
4
|
+
|
|
5
|
+
Raw repository docs, tests, interfaces, config, and code remain canonical.
|
|
6
|
+
|
|
7
|
+
## Entries
|
|
8
|
+
|
|
9
|
+
<!-- wiki:entries:start -->
|
|
10
|
+
- Scaffold initialized. Append timestamped `wiki-ingest`, `wiki-query --writeback`, and `wiki-lint` entries below.
|
|
11
|
+
<!-- wiki:entries:end -->
|