Skip to content

Insight Pre-Trade Safety AGENTS.md changelog

io.github.imokokok/insight-oracle

4 changes recorded. MCP Harbor re-reads this listing from the official registry every six hours and asks the live server what it exposes, and keeps what changed between one look and the next.

  • AGENTS.md +64 −65

    https://raw.githubusercontent.com/imokokok/Insight/HEAD/AGENTS.md

    − Multiple agent sessions share this repository. Feature work happens in a per-task− Git worktree, never in the primary checkout:− ```sh− npm run wt -- create <slug> --type <feat|fix|chore|docs|test|perf|ops|refactor> \−                         --paths "src/**,supabase/migrations/*" --goal "..."− npm run wt -- status                                  # task -> branch -> worktree -> PR -> CI− npm run wt -- queue                                   # open PRs in merge order− npm run wt -- ship <slug> --message "feat: subject"   # commit + PR + auto-merge + cleanup− npm run wt -- deps <slug> --isolate                    # real node_modules before a dependency change− npm run wt -- handoff <slug> --next "..."             # context for any session− npm run wt -- resume <slug>                           # take over a killed/paused task− npm run wt -- cleanup                                 # merged agent branches only− ```− - One task = one branch (`wt/<type>-<slug>[-<session>]`) = one worktree under−   `~/Documents/insight-worktrees/`. Never reuse a branch between sessions.− - Declare the paths you expect to touch at `create --paths`. A create/claim−   refused for overlap means another active task owns those paths; coordinate−   instead of passing `--override`. Claim metadata lives in−   `<git common dir>/insight-tasks/` and is released when the task ends.− - Do not run `git checkout`, `git stash`, `git reset --hard`, `git clean` or−   `git add` in the primary checkout. Those are shared-state operations; another−   session may own the index and HEAD at that moment.− - Never run `git gc` or `git repack -a`; worktrees share the object database and−   a concurrent repack slows every session.− - Worktree dependencies are symlinked from the primary checkout. Do not run−   `npm install` in the primary checkout for worktree work. A task that changes−   any `package.json`/`package-lock.json` (including nested workspaces) must run−   `npm run wt -- deps <slug> --isolate` first; `ship` refuses to commit while−   that directory's `node_modules` is still the shared link.− - Dependency manifests, `.github/cron-dist/*` and `supabase/migrations/*` /−   `migrations/*` are serial by category: a second claim is refused, and `ship`−   will not enable auto-merge while another active claim or open PR touches one.−   There is no override for these.− - Same file in different regions may proceed in parallel; `check` and `ship`−   compare `git diff -U0` hunks against open PRs and block only overlapping−   ranges (`hunk-overlap`). Do not add file-level exclusivity for ordinary files.− - Use `npm run wt:dev` and `npm run wt:e2e` so each worktree binds its own−   allocated port; never rely on the default `3000`.− - Build caches (`.next`, `*.tsbuildinfo`, `.eslintcache`) are isolated because−   each worktree is its own directory. The pre-commit hook runs+ ## Task boundaries and efficient execution+ - Before editing, confirm the active repository, worktree, claimed paths, and existing changes. Honor path claims; never use `--override` to bypass another task's ownership.+ - Read only the files needed for the request. Batch independent local inspections; keep commands bounded and avoid duplicate searches, broad output, unnecessary network calls, polling, retries, and downloads.+ - Use the narrowest checks required by the task, report exactly what ran, and stop when the requested outcome is complete. Do not continue into adjacent cleanup or release work.+ - Keep task-owned processes bounded, stop those no longer needed, and verify they stopped. Never stop user-owned or pre-existing processes.+ - Editing files does not authorize commits, pushes, PR creation or merge, deployment, migrations, or other external writes. Perform release or external actions only when the user explicitly requests them.+ - One task = one unique branch and worktree. Declare paths with `npm run wt -- create <slug> --type <type> --paths "..." --goal "..."`; if a claim is refused, coordinate instead of overriding it.+ - Keep the primary checkout untouched for task work. Never run shared-state commands there (`git checkout`, `git stash`, `git reset --hard`, `git clean`, `git add`, `git gc`, or `git repack`); do not move or discard another session's branch or changes.+ - Before changing a dependency manifest or lockfile, run `npm run wt -- deps <slug> --isolate`. Never install through shared or symlinked dependencies. Dependency manifests, cron bundles, and migrations are serial claim categories.+ - Use the allocated ports and `npm run wt:dev` / `npm run wt:e2e` wrappers. Use `handoff` before a long pause and `resume` when taking over.+ - After confirming the change is merged on the target remote, check whether `ship` already removed this worktree. If it remains, confirm there are no uncommitted changes or handoff material to retain, then run `npm run wt -- remove <slug> --delete-branch` to release the task claim and remove its worktree and local branch. Never clean another task's worktree.+ - `ship` is the only commit, push, PR, and auto-merge path; use it only after explicit release authorization.+ ## Protected PRs and parallel merging+ - `ship` returns after opening or updating a PR and enabling auto-merge by default. Continue independent work while required checks run; use `ship --wait` only when a coordinator needs the merge result in the current session.+ - Use `queue` as a status view, not as a manually enforced merge order. GitHub auto-merge and branch protection decide when each PR is ready to land.+ - Keep required checks and strict branch protection enabled. If a PR becomes `BEHIND`, rerun `ship` for that task from its own worktree; the tool syncs the latest base into only that branch, checks for collisions again, and refreshes CI without rewriting the remote branch.+ - Resolve a real conflict or overlapping hunk in the worktree that owns the change. Shared serial resources such as dependency manifests, migrations, and generated cron bundles remain serialized; unrelated tasks continue in parallel.+ ## Database migrations+ - Migration numbers are one global four-digit sequence; do not reuse numbers. `0076` is the only documented historical gap.+ - Before writing or applying a migration, run `node --import tsx scripts/check-migration-drift.mts --linked` and reconcile both directions of the ledger. AHEAD means the database has versions missing from the repository; do not reuse them. BEHIND means code may depend on a migration not applied to the database.+ ## Database resource consumption+ - For every change that reads, writes, scans, batches, retries, or schedules database work, assess the resource dimensions it affects: rows examined and returned, query count, index/scan shape, page depth or cursor use, bytes read and written, batch size, transaction duration, concurrency/fanout, retries, storage growth, compute time, network egress, and schedule frequency. Bound per-request and per-run work where appropriate. A SQL `LIMIT` caps returned rows, not necessarily scanned or billed r+ - Prefer index-backed filters, keyset pagination for sequential history reads, bounded batches, and idempotent writes. Preserve the user-required collection cadence and product capabilities; account for fallback and failover paths when assessing load.+ - Before introducing provider quotas or hard limits, assess whether exhaustion can suspend service or redirect load to another database. Do not treat application-side row counts as provider-billed usage.+ - Support resource-savings claims with provider usage metrics and timestamps. Label estimates and application-level counters separately; do not claim a reduction until comparable before/after usage data exists.+ ## Measurement provenance+ - Any capacity, row-count or byte-size number written into code comments, docs,+   PR descriptions or reports must say where it came from and when: a query+   (`count(*)`, `pg_database_size()`, `pg_total_relation_size()`,+   `pgstatindex`/`pgstattuple`, `EXPLAIN (ANALYZE, BUFFERS)`), or an explicit+   estimate.+ - Estimates must be labelled as estimates (`estimate`/`推算`) and state the+   inputs and assumptions. Never present an extrapolation (for example+   "archive adds 20–25 MB per archived day", "the database will fall back to X",+   "hourly steady state is 300 MB") as an observed measurement.+ - A value with no source must be treated as unknown, not as a baseline. When a+   previously published figure turns out to be an estimate, correct it in a+   dated change record rather than silently editing it.+ ## Cleanup and retention changes+ - Every new or changed cleanup step must be able to prove its real impact:

    Showing the first 40 of each.

  • AGENTS.md +61

    https://raw.githubusercontent.com/imokokok/Insight/HEAD/AGENTS.md

    + ## Parallel agent work (mandatory)+ Multiple agent sessions share this repository. Feature work happens in a per-task+ Git worktree, never in the primary checkout:+ ```sh+ npm run wt -- create <slug> --type <feat|fix|chore|docs|test|perf|ops|refactor> \+                         --paths "src/**,supabase/migrations/*" --goal "..."+ npm run wt -- status                                  # task -> branch -> worktree -> PR -> CI+ npm run wt -- queue                                   # open PRs in merge order+ npm run wt -- ship <slug> --message "feat: subject"   # commit + PR + auto-merge + cleanup+ npm run wt -- deps <slug> --isolate                    # real node_modules before a dependency change+ npm run wt -- handoff <slug> --next "..."             # context for any session+ npm run wt -- resume <slug>                           # take over a killed/paused task+ npm run wt -- cleanup                                 # merged agent branches only+ ```+ - One task = one branch (`wt/<type>-<slug>[-<session>]`) = one worktree under+   `~/Documents/insight-worktrees/`. Never reuse a branch between sessions.+ - Declare the paths you expect to touch at `create --paths`. A create/claim+   refused for overlap means another active task owns those paths; coordinate+   instead of passing `--override`. Claim metadata lives in+   `<git common dir>/insight-tasks/` and is released when the task ends.+ - Do not run `git checkout`, `git stash`, `git reset --hard`, `git clean` or+   `git add` in the primary checkout. Those are shared-state operations; another+   session may own the index and HEAD at that moment.+ - Never run `git gc` or `git repack -a`; worktrees share the object database and+   a concurrent repack slows every session.+ - Worktree dependencies are symlinked from the primary checkout. Do not run+   `npm install` in the primary checkout for worktree work. A task that changes+   any `package.json`/`package-lock.json` (including nested workspaces) must run+   `npm run wt -- deps <slug> --isolate` first; `ship` refuses to commit while+   that directory's `node_modules` is still the shared link.+ - Dependency manifests, `.github/cron-dist/*` and `supabase/migrations/*` /+   `migrations/*` are serial by category: a second claim is refused, and `ship`+   will not enable auto-merge while another active claim or open PR touches one.+   There is no override for these.+ - Same file in different regions may proceed in parallel; `check` and `ship`+   compare `git diff -U0` hunks against open PRs and block only overlapping+   ranges (`hunk-overlap`). Do not add file-level exclusivity for ordinary files.+ - Use `npm run wt:dev` and `npm run wt:e2e` so each worktree binds its own+   allocated port; never rely on the default `3000`.+ - Build caches (`.next`, `*.tsbuildinfo`, `.eslintcache`) are isolated because

  • AGENTS.md +3

    https://raw.githubusercontent.com/imokokok/Insight/HEAD/AGENTS.md

    + ## GitHub CLI device authorization+ - If GitHub CLI authentication has expired and the standard `gh auth login --hostname github.com --web --git-protocol https` flow is needed, start the flow only when authorized. As soon as GitHub returns a one-time device code, tell the user the code and `https://github.com/login/device` before asking them to authorize, opening the browser, or waiting for completion.+ - Never store a one-time device code in workspace memory, repository files, or logs. Never ask the user to paste a GitHub token into chat.