|
| 1 | +# AGENTS.md — dsh-advisor |
| 2 | + |
| 3 | +Project-level rules for coding agents in this repository. This file is the |
| 4 | +**project layer**; the Morning Star harness lives under `.mstar/` (see |
| 5 | +[Process artifacts](#process-artifacts)). |
| 6 | + |
| 7 | +## Source priority |
| 8 | + |
| 9 | +1. The current user instruction |
| 10 | +2. This file (project rules) |
| 11 | +3. `.mstar/` harness rules (`mstar-*` skills) |
| 12 | +4. Role references (`mstar-roles`) |
| 13 | + |
| 14 | +## Repository |
| 15 | + |
| 16 | +`dsh-advisor` is a standalone TypeScript plugin bundle for dsh (DeepSeek |
| 17 | +Harness), porting the omp "advisor" subsystem: a **per-session reviewer |
| 18 | +model** that observes the primary transcript, reviews each stepped turn with |
| 19 | +an explicitly configured model (provider + model are required), and injects |
| 20 | +severity-ranked advice (nit / concern / blocker) back into the session — |
| 21 | +without polluting or recursively reviewing itself. It is advisory only: it |
| 22 | +never approves or rejects the primary agent's actions. |
| 23 | + |
| 24 | +- Mounts into dsh as a **bundle** (`dsh.bundle.patch` → `cordis.patch.yml`) |
| 25 | + inserting one plugin row (`id: advisor`) — no host patching, no |
| 26 | + postinstall step. |
| 27 | +- Runtime: Node ^22.19 || >=24, pnpm 11.21+ (project stack: pnpm 11.21.0 in |
| 28 | + CI). Private `@deepseek-ai/*` packages are `peerDependencies` ONLY, |
| 29 | + resolved from the npm registry (see [Code constraints](#code-constraints)). |
| 30 | +- License: MIT (`LICENSE` is authoritative). |
| 31 | + |
| 32 | +## Build & test interface |
| 33 | + |
| 34 | +- `pnpm typecheck` — full typecheck (`tsc --noEmit` over the main, client, |
| 35 | + and spec tsconfigs). |
| 36 | +- `pnpm build` — `tsc -p tsconfig.build.json` → `node scripts/build-client.mjs`. |
| 37 | +- `pnpm test` — vitest run (full suite; includes the release-script |
| 38 | + contract tests in `tests/prepare-release.test.ts`). |
| 39 | +- **Release prep — no `pnpm release:*` scripts**: the Release prep workflow |
| 40 | + (`.github/workflows/release-prep.yml`) runs |
| 41 | + `node scripts/prepare-release.mjs [version]` (see |
| 42 | + [Release flow](#release-flow)). |
| 43 | +- Local workflow lint (not in CI): `actionlint .github/workflows/*.yml` |
| 44 | + (ci + release-prep + release). |
| 45 | + |
| 46 | +## Changelog |
| 47 | + |
| 48 | +`CHANGELOG.md` is **auto-generated from git log** by |
| 49 | +`scripts/prepare-release.mjs` during release prep: it resolves the commit |
| 50 | +range since the previous release tag and writes a `## [X.Y.Z] - YYYY-MM-DD` |
| 51 | +section (existing sections are preserved; re-running the same version does |
| 52 | +not duplicate it). There is **no `.changes/` fragment model** (unlike the |
| 53 | +sibling dsh-llm-fallbacks) — nothing to write per change; the changelog |
| 54 | +section is derived from the commits that ship in the release PR. |
| 55 | + |
| 56 | +## Release flow |
| 57 | + |
| 58 | +PR-driven, two steps — merging the release PR is the ONLY publish path |
| 59 | +(no `push:tags` auto-publish): |
| 60 | + |
| 61 | +1. **Release prep** (manual: Actions → Release prep → Run workflow): runs |
| 62 | + `scripts/prepare-release.mjs`, bumps `package.json` (+ lockfile sync), |
| 63 | + validates (typecheck + build + test), and opens/updates a |
| 64 | + `release vX.Y.Z` PR (base `main`, label `release`). Pass an explicit |
| 65 | + version (`X.Y.Z` or `X.Y.Z-alpha.N`) or leave the input empty for an |
| 66 | + auto bump that **stays on the current prerelease line** |
| 67 | + (`0.1.3-alpha.3` → `0.1.3-alpha.4`; it never silently drops the suffix |
| 68 | + to a formal version). An empty commit range (no releaseable content) |
| 69 | + or an already-tagged version fails the prep. |
| 70 | +2. **Merge the PR** → `release.yml` runs on the merge commit: validate → |
| 71 | + sanity gate (typecheck + build + test) → `npm publish --provenance |
| 72 | + --access public` (OIDC trusted publishing, no npm secrets) → tag |
| 73 | + `vX.Y.Z` → GitHub Release. Prerelease versions publish to their |
| 74 | + prerelease dist-tag (`alpha`, never touching `latest`) and are marked |
| 75 | + Pre-release on GitHub; formal versions publish to `latest`. |
| 76 | + |
| 77 | +> **Current policy (maintainer-owned; full callouts in `docs/release.md`):** |
| 78 | +> release ONLY alpha prereleases (`X.Y.Z-alpha.N`) until further notice, |
| 79 | +> and ONLY when the merged content carries substantive changes (code / |
| 80 | +> behavior / user-visible docs or config). Trivial commits merge straight |
| 81 | +> to `main` and ride the next substantive release. |
| 82 | +
|
| 83 | +Secrets: **zero long-term secrets**. npm auth is OIDC trusted publishing |
| 84 | +(tokenless); workflows use only the built-in `GITHUB_TOKEN` (release-prep |
| 85 | +additionally uses a PAT for the label/PR steps). Full SOP and rollback → |
| 86 | +`docs/release.md`. |
| 87 | + |
| 88 | +## Code constraints |
| 89 | + |
| 90 | +- **Mount-only**: the plugin never modifies the dsh source tree (bundle |
| 91 | + insert only; no patches, no postinstall step). Keep it that way. |
| 92 | +- **Peers from the public registry**: all `@deepseek-ai/*` packages are |
| 93 | + `peerDependencies` ONLY — resolved from the npm registry at dev time |
| 94 | + (`autoInstallPeers` in `pnpm-workspace.yaml` + user-level `~/.npmrc` |
| 95 | + token), never added to `dependencies`/`devDependencies`, never linked |
| 96 | + locally. `tests/peer-deps.test.ts` enforces this contract. |
| 97 | +- **English commit messages**, conventional style (`feat:`, `fix:`, |
| 98 | + `docs:`, `chore:`, ...). |
| 99 | +- **Feature branch → PR → main** for all changes; never commit directly to |
| 100 | + `main`. |
| 101 | +- Match existing patterns and keep diffs surgical. |
| 102 | + |
| 103 | +## Process artifacts |
| 104 | + |
| 105 | +`.mstar/` is the Morning Star harness's local process SSOT: process artifacts |
| 106 | +(`plans/`, `sdd/`, `status.json`, `iterations/`, ...) are **gitignored**; |
| 107 | +tracked results are `.mstar/knowledge/` and `.mstar/specs/` (the frozen |
| 108 | +`advisor-plugin.md` spec is the `primary_spec` anchor). Harness rules live |
| 109 | +in the `mstar-*` skills; harness-layer details (path symbols, content |
| 110 | +boundaries) are in `.mstar/AGENTS.md`. This file intentionally carries no |
| 111 | +dynamic state, current progress, or review details. |
0 commit comments