-
Notifications
You must be signed in to change notification settings - Fork 0
docs: reconcile canonical runtime authority with protected develop #503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
seonghobae
wants to merge
16
commits into
develop
Choose a base branch
from
docs/reconcile-shipped-runtime-authority-20260815
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
345fffd
docs: reconcile agent guidance with shipped dual runtime
seonghobae cd42985
docs: describe protected dual-mode architecture
seonghobae 9e307e5
docs: replace historical SaaS merge map with shipped truth
seonghobae 2911afc
Merge branch 'develop' into docs/reconcile-shipped-runtime-authority-…
opencode-agent[bot] a0491a1
merge(docs): reconcile protected XML import baseline
seonghobae 36c47db
merge(docs): reconcile runtime authority with current protected develop
seonghobae 0ffafdf
merge(develop): reconcile canonical docs with OpenCode config
seonghobae 0c5f28b
fix(docs): preserve NIM-only credential contract
seonghobae 4a6d3f6
Merge branch 'develop' into docs/reconcile-shipped-runtime-authority-…
opencode-agent[bot] 8777039
Merge branch 'develop' into docs/reconcile-shipped-runtime-authority-…
opencode-agent[bot] 72865db
merge(develop): preserve protected dependency state in canonical docs…
seonghobae 9dc7d6f
test(docs): fail on stale merge-order guidance
seonghobae a6df3bd
fix(docs): use live ancestry for stacked PR guidance
seonghobae 39c9834
test(docs): reject dangling canonical guidance
seonghobae abc9639
docs: point env guidance to deploy reference
seonghobae a2f8963
docs: add Ask DeepWiki badge
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,78 +1,77 @@ | ||
| # AGENTS.md | ||
|
|
||
| ## Project overview | ||
| ## Product boundary | ||
|
|
||
| - ScopeWeave Planner is a pure HTML/CSS/JavaScript WBS planning web app. | ||
| - Runtime dependencies are forbidden; development-only tooling is allowed. | ||
| ScopeWeave is one product with two independently usable runtime profiles: | ||
|
|
||
| ## Defaults | ||
| - **Standalone** — static `index.html`/CSS/JavaScript, local-first persistence, no server or runtime package requirement, deployable to GitHub Pages or any static host. | ||
| - **Cloud/SaaS** — the same client with `cloud-sync.js` plus the Node server under `server/`, multi-tenant persistence, authentication, collaboration, analytics and integrations. | ||
|
|
||
| - Keep the runtime static-host compatible for GitHub Pages. | ||
| - Preserve the single global `tasks` array as the source of truth. | ||
| - Use a single `renderAll()` integration path for user-visible rerenders. | ||
| - Prefer browser-native APIs only. | ||
| Protected `develop` is the authority for what is shipped. PR bodies, issue text, plans and chat are evidence only. Never describe behavior that exists only on an open PR as shipped. | ||
|
|
||
| ## Architecture invariants | ||
|
|
||
| - Preserve standalone static-host compatibility even when changing cloud behavior. | ||
| - Preserve the client `tasks` array as the canonical in-browser work-item state and `renderAll()` as the user-visible rerender integration path unless an accepted ADR supersedes that contract. | ||
| - `app.js` must remain eval-safe: no top-level `import` or `export`. Optional browser modules bridge through explicit `window.ScopeWeave*` interfaces. | ||
| - Cloud code may use the runtime dependencies already declared in `package.json`; adding or replacing production dependencies requires a bounded justification, supply-chain review and compatible standalone behavior. | ||
| - `server/db.mjs` currently owns SQLite persistence. PostgreSQL is a migration target, not shipped truth until an integrated adapter and migration evidence exist. | ||
| - Cross-service integrations such as Clearfolio and contextual-orchestrator are replaceable adapters. ScopeWeave owns its validation, authorization and failure boundary; it does not duplicate another CWL service's internal authority. | ||
| - Do not silently promote development mocks or deterministic fallbacks to production readiness. When a production boundary is incomplete, document it as a current gap or active PR. | ||
|
|
||
| ## Database contract | ||
|
|
||
| - New owned database objects use descriptive two-or-more-word `snake_case` names. | ||
| - Keep relational designs in third normal form unless a documented, measured exception is accepted. | ||
| - Schema changes require migration, rollback/recovery and populated-database tests; request-time DDL is not a migration strategy. | ||
| - Preserve tenant isolation and optimistic-concurrency semantics across persistence adapters. | ||
|
|
||
| ## Verification | ||
|
|
||
| - Serve locally with `python3 -m http.server 4173`. | ||
| - Run end-to-end verification with `npm run test:e2e`. | ||
| - Run workflow ownership checks with `python3 -m pytest tests/config`. | ||
|
|
||
| ## CI / security workflow notes | ||
|
|
||
| - OpenCode Review, Strix Security Scan, and PR Review Merge Scheduler are | ||
| organization-level required workflows from `ContextualWisdomLab/.github`. | ||
| Do not copy them into this repository. | ||
| - ScopeWeave's repository-local `opencode.jsonc` is development configuration, | ||
| not a replacement for the organization review workflow. It uses NVIDIA NIM | ||
| only and reads the process-local `NVIDIA_API_KEY` binding. Organization CI | ||
| owns secret injection and maps the organization `NVIDIA_NIM_API_KEY` secret | ||
| into that process binding; do not add a repository-local OpenCode workflow or | ||
| restore GitHub Models/COPILOT credentials to this configuration. | ||
| - Keep companion SCA workflows development-only; do not add runtime | ||
| dependencies. | ||
| - If GitHub CLI output emits Projects(classic) deprecation warnings, | ||
| prefer `gh api` or explicit `--json` field selection over default | ||
| human-formatted `gh issue view` / `gh pr view` output. | ||
|
|
||
| <!-- BEGIN cwl-agent-guidance --> | ||
| ## Agent guidance (CWL governance) | ||
|
|
||
| Cross-agent conventions for any agent working in this repo (Claude, Codex, | ||
| Cursor, opencode, ...). Distilled from ContextualWisdomLab governance. | ||
|
|
||
| ### Security & review gate | ||
|
|
||
| - Every PR runs a central **Security Scan** required gate: `osv-scan` + | ||
| `dependency-review` (diff-scoped) and `trivy-fs` (repo-wide, CRITICAL/HIGH, | ||
| fixable only). It runs against every PR base, **including stacked PRs**. | ||
| - A failing `trivy-fs` is a **REAL finding, not a flake.** Read the job log and | ||
| the uploaded SARIF/code-scanning results to identify each rule id, severity, | ||
| file, and line before changing code. SARIF-mode Trivy logs may only show the | ||
| scanner configuration and exit code, so use code scanning or the SARIF | ||
| artifact when the log does not enumerate findings. Then **remediate**: bump | ||
| the offending dependency, fix the misconfig in | ||
| `Dockerfile` or `infra/k8s/*.yaml`, or add a narrow, documented | ||
| `.trivyignore` (`.trivyignore.yaml`) entry only for a genuine false positive. | ||
| Never weaken, skip, or disable the gate. | ||
| - A local scan with a stale DB misses findings. Run | ||
| `trivy --download-db-only` first, then scan the **merge ref**, not just the PR | ||
| head, e.g. `trivy fs --severity CRITICAL,HIGH --ignore-unfixed .`. | ||
| - Worked example from the historical PR queue: the misconfig scan flagged | ||
| **KSV-0020 / KSV-0021** (UID/GID `<= 10000` — `infra/k8s/deployment.yaml` | ||
| uses `runAsUser/runAsGroup: 101`), **KSV-0110** (no explicit `namespace`, so | ||
| the manifests land in `default`), and **DS-0026** (no `HEALTHCHECK` in the | ||
| `Dockerfile`). Fix these in-tree; do not ignore them. | ||
| - The org `code_scanning` ruleset is intentionally **CodeQL-only** (multiple | ||
| code-scanning tools cannot converge on one PR ref). Gating is by the Security | ||
| Scan **job result**, not the `code_scanning` rule — do not add tools to that | ||
| rule. | ||
|
|
||
| ### Code exploration | ||
|
|
||
| - Initialize and sync CodeGraph before review or edits, then keep it current | ||
| after rebases and source changes. Use CodeGraph (`codegraph status`, | ||
| `codegraph sync`, `codegraph explore "<query>"`, or the code-review-graph MCP | ||
| tools) as the first structural map, with ripgrep/find as a fast companion for | ||
| exact text search. | ||
| <!-- END cwl-agent-guidance --> | ||
| Run the applicable repository-native paths before requesting merge: | ||
|
|
||
| ```bash | ||
| npm run test:unit | ||
| npm run test:api | ||
| npm run test:coverage | ||
| npm run test:e2e | ||
| npm run test:e2e:cloud | ||
| npm run fuzz | ||
| python3 -m pytest tests/config | ||
| ``` | ||
|
|
||
| `server-tests.yml`, Fuzz, Dependency Review, OSV Scanner and repository security workflows are source evidence only for the exact commit they checked out. Organization-required OpenCode/Noema/Strix/Security/SAST/merge-policy evidence is inherited from `ContextualWisdomLab/.github` and must not be copied into this repository. | ||
|
|
||
| ## Review and merge discipline | ||
|
|
||
| - Refetch the exact PR head and the current protected `develop` tip before every source, docs, ref or PR-state mutation. | ||
| - Verify review findings against the current source. Fix valid findings test-first; resolve only addressed threads. | ||
| - A queued, skipped, cancelled, failed, neutral-required, missing, predecessor-head or stale-base check is not passing evidence. | ||
| - COMMENTED reviews, status checks and model text are not a qualifying formal approval. | ||
| - Never self-approve, manufacture approval, weaken rulesets, force-push, destructively rebase or move a branch to make stale evidence appear current. | ||
| - If a check or reviewer is waiting, rotate to another non-conflicting lane rather than churning a clean head. | ||
| - Compare moved/old branches against protected `develop` for unintended deletion or weakening of already-shipped authentication, session revocation, attachment/Clearfolio boundaries, coverage contracts, persistence and operability behavior. | ||
|
|
||
| ## Security and privacy | ||
|
|
||
| - Treat every external provider response, imported document, persisted identifier and review body as untrusted data. | ||
| - Bound network time, redirects, response bytes, parsing and concurrency at the owning adapter boundary. | ||
| - Keep secrets out of browser responses, logs, metrics labels and model context. | ||
| - PII required for legitimate work is protected with purpose-bound authorization, least privilege, tenant/context isolation, encryption, retention and auditable access rather than indiscriminate masking. | ||
| - A failing security gate is a real blocker until evidence proves a false positive; never disable or weaken a gate to merge. | ||
| - Design for CSAP/SOC 2 evidence readiness without claiming certification. | ||
|
|
||
| ## LLM and automation | ||
|
|
||
| - Model-backed development/tests use `NVIDIA_NIM_API_KEY`, preferably through contextual-orchestrator/OpenCode. Keep development-model execution on the NVIDIA NIM credential path and preserve independent reviewer credentials. | ||
| - ScopeWeave's repository-local `opencode.jsonc` is development configuration, not a replacement for the organization review workflow. It uses NVIDIA NIM only and reads the process-local `NVIDIA_API_KEY` binding; organization CI owns secret injection and maps the organization `NVIDIA_NIM_API_KEY` secret into that process binding. Do not add a repository-local OpenCode workflow or restore GitHub Models/COPILOT credentials to this configuration. | ||
| - Model output is untrusted proposal data. Deterministic authorization, security, merge and release gates remain independent of model judgment. | ||
| - Initialize/sync CodeGraph or code-review-graph when available before structural edits; use exact text search as a companion, not a substitute for source verification. | ||
|
|
||
| ## Documentation authority | ||
|
|
||
| Keep `README.md`, `ARCHITECTURE.md`, `CLAUDE.md`, product/technical requirements, ADRs, security/threat model, test strategy, operability/recovery, traceability and `CHANGELOG.md` aligned with protected code. Clearly label active-PR, planned, research-only and superseded behavior. Documentation is product memory, not proof that implementation exists. | ||
|
|
||
| ## Release discipline | ||
|
|
||
| Version/tag/publish only from one exact integrated protected head after all applicable CI, security, coverage/docstrings, package/build, SBOM/provenance, compatibility, review, migration/rollback/recovery, accessibility and operational acceptance gates pass together. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.