Cleanup: dead code, doc drift, duplicated rules, and inconsistent helpers
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
調査の方向性
Start with the listed acceptance criteria and the referenced files across src/engine, src/storage, src/cli, src/validation, and src/application; the issue spans many subsystems and several independent changes. Check the existing tests for each area before changing behavior. Done means the accepted cleanup items are addressed consistently and the relevant tests pass.
索引モデルが issue の本文から書いたものです。
説明
LOW-severity cleanup: dead code, doc drift, duplicated rules
This is a cleanup umbrella issue for the batch of LOW-severity findings from
the deep audit. None of these are bugs that affect users today, but they're
inconsistencies and dead code that make the codebase harder to maintain.
Findings covered
| ID | Description | Where |
|---|---|---|
| A2 | detectCycles/validateDependencyGraph still enumerate cycles unbounded after #79 migration; 2 stale docblocks |
src/engine/dependency.ts:317,520-523,989; src/validation/rules/no-dependency-cycle.ts:6-7 |
| A3 | src/engine/index.ts:4-7 calls it "DAG analysis" but it detects/quarantines cycles; dependency.ts:4-6 says "depth-first cycle detection" contradicting the real algorithm |
src/engine/index.ts, src/engine/dependency.ts:4-6 |
| A7 | occConflict helper used at 1 site; 9 others hand-roll identical error; OCC block duplicated as post-write re-check (#479) |
src/storage/atomic-write.ts:233,375,389-391,400-403,409-411,446-450,461-463,503-537 |
| A8 | CONTAINMENT_ERROR_CODE exported, zero consumers; isContainmentError re-exported from 2 modules |
src/storage/containment.ts:185; src/storage/atomic-write.ts:580 |
| A9 | WHY-comments point to wrong locations (toc-chain.ts cited for isWithinVault which is in wikilink.ts; rotted line refs) |
src/storage/containment.ts:6; src/storage/lock.ts:50,360 |
| A10 | Windows retry policy hand-duplicated between lock.ts and atomic-write.ts (+ 3rd copy in test) | src/storage/lock.ts:52-56 vs src/storage/atomic-write.ts:29-33; test/storage-lock.test.ts:526 |
| A13 | adopt --undo skips the #311 vault echo (only mutating command that doesn't name its vault) |
src/cli/adopt-undo.ts:585 |
| A15 | y/N prompt accepts y or yes in adopt/adopt-undo but only y in roadmap; EOF exits 0 silently in 3 of 4 sites |
src/cli/adopt.ts:69-82; src/cli/adopt-undo.ts:152-165; src/cli/roadmap.ts:1055-1058 |
| A16 | assess --force help says "re-hides dependents without printing the warning" — that warning path never fires on TOC-adopted vaults |
src/cli/assess.ts |
| A17 | Mastery threshold "Mastered (≥70%)" hardcoded in plan/progress/dashboard but derived from constant in assess | src/cli/plan.ts:257; src/cli/progress.ts:251; src/cli/dashboard.ts:176 |
| A18/A41 | NextTopic.difficulty declared + populated but no reader exists |
src/application/get-next-topics.ts:27,172 |
| A20 | Empty --topic "" handled 3 ways: progress treats as flag-absent, review/assess pass through (matches all), session guards it |
src/cli/progress.ts:98; src/cli/topic-query.ts:63-67; src/cli/review.ts:52; src/cli/assess.ts:188; src/cli/session.ts:99 |
| A21 | Lesson-ranking/keyword rules hand-synced across 3 engine files; diverge on non-.md basenames | src/engine/toc-chain.ts:964-980; src/engine/auto-chain.ts:620-645 |
| A22 | tocChainable's paleeId parameter has no caller |
src/engine/toc-chain.ts:1157 |
| A25 | patternHitsFile's basename branch (line 333) is shadowed by matchPathGlob's fast path (227-230) |
src/storage/pattern-matcher.ts:333 |
| A26 | wikilink.ts:284,303: existsSync + statSync unguarded → raw ENOENT instead of UnresolvedWikilinkError |
src/storage/wikilink.ts:284,303 |
| A27 | Hedge sentence "i is in bounds, so this exists..." copy-pasted ~15 sites across 4 files |
src/storage/pattern-matcher.ts:47,159,243,279 + others |
| A32 | scanner.ts has a default export nobody imports (only default export in storage layer) |
src/storage/scanner.ts:326-327 |
| A33 | 3 diagnostic sites bypass displayValue() → YAML .nan reported as literal null |
src/validation/rules/valid-palee-schema.ts:57,61,72; src/validation/rules/valid-topic-id-format.ts:62; src/validation/rules/valid-topic-status.ts:49 |
| A34 | Sorting split between localeCompare and code-unit < across validation rules |
src/validation/rules/valid-topic-mastery.ts:175-179 vs others |
| A35 | 3 cross-reference rules resolve readIncomplete in opposite ways |
src/validation/rules/valid-hot-memory.ts:112; no-session-unknown-topic.ts:27-31; valid-session-index.ts:47-86 |
| A36 | FrontmatterResult.doc produced by parseFrontmatter, read by zero callers |
src/types.ts:451; src/storage/frontmatter.ts:88 |
| A37 | valid-topic-mastery.ts:89-107: 13-line jurisdiction guard with unreachable inner branch + comment misdescribes behavior |
src/validation/rules/valid-topic-mastery.ts:92-107 |
| A38 | OpenAICompatibleProvider.forConfig (provider.ts:512-517) has zero callers |
src/ai/provider.ts:512-517 |
| A39 | Credential-redaction expression written twice (provider.ts:189 inline + provider.ts:746 maskSecret) | src/ai/provider.ts:189,746 |
| A40 | readScoreRange builds identical error string in 2 branches; {value?; error?} shape forces caller cast |
src/application/record-assessment.ts:26-29,33-37 |
| A43 | y/N prompt implemented 3 ways (config.ts, adopt.ts, adopt-undo.ts, roadmap.ts) with divergent EOF/SIGINT | src/cli/config.ts:424-449; src/cli/adopt.ts:69-82; src/cli/adopt-undo.ts:152-165; src/cli/roadmap.ts:1055-1058 |
| A45 | palee plan runs quarantineCyclicTopics twice over the same topic map |
src/cli/plan.ts:87,129 |
| A46 | Four-pillar key tuple redeclared 5× across 4 layers under 4 names | src/cli/validate.ts:101; src/engine/mastery.ts:74; src/application/record-assessment.ts:13; src/validation/rules/valid-assessment-fields.ts:19,valid-topic-mastery.ts:34 |
| L9 | Docsify nav chrome + teacher/repo-meta notes adopted as topics in both plain and chained scans | live: webdev |
| L13 | review prints vault echo before a failed topic lookup, naming a vault it never touched |
live: webdev |
Acceptance criteria
- A2: Remove or bound
detectCycles/validateDependencyGraph, or update
the docblocks. DeletedetectCycle(zero callers). - A7: Route all 10 OCC error sites through
occConflict. Factor the
exists→read→fingerprint→compare block into one helper shared by the
pre-write and post-write checks. - A8: Make
CONTAINMENT_ERROR_CODEmodule-private. Drop the
isContainmentErrorre-export fromatomic-write.ts. Redirect the one test
import. - A10: Hoist the Windows retry constants + backoff formula into one shared
module. Both files import it. Test imports the constant instead of copying. - A13:
adopt --undocallsresolveVaultTarget(config, { json: false })
like siblingadopt.ts:206. - A15 + A43: One shared
promptConfirmationhelper insrc/cli/with
EOF/SIGINT handling, used by all 4 sites. - A17: Render the mastery-threshold label from
MASTERY_THRESHOLD
everywhere, likeassess.tsdoes. - A21: Hoist
compareLessonOrderTier0and keyword matching into
tier0-hygiene.ts. DeletetocLessonRankandtier0LessonRank. - A34: One shared code-unit comparator for all validation rules.
- A35: Pick one policy for
readIncompleteand apply it in all 3 rules. - A38: Delete
OpenAICompatibleProvider.forConfigor use it at the one
call site. - A39:
describeForeignTextcallsmaskSecret(secret, text). - A43 + A15: (Same fix, same helper.)
- A45:
findPrerequisiteBlockedaccepts an already-quarantined subgraph;
plan.tsderives both blocked + ready from one decomposition. - A46: Import
PILLAR_KEYSfrom the engine. Delete the 4 local tuples. - Tests for each fix where reasonable.
I did not use AI to generate this issue report.
- 主要言語
- TypeScript
- スター
- 1
- フォーク
- 0
- 平均マージ
- 15時間 5分
- マージ済み PR(30日)
- 163
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Kuldeep2822k/cli のほかの issue
-
feat: comprehensive observability layer (diagnostics + metrics)対応中かも @Kuldeep2822k が 2 日前に担当しました。 オープンcli core enhancement storage tests
Kuldeep2822k/cli#591 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Task: Full-repository improvement audit at 24947bc — verified P1/P2/P3 remediation checklist対応中かも @Kuldeep2822k が 8 日前に担当しました。 オープンchore ci cli core dependencies P1 security storage tests working
Kuldeep2822k/cli#565 · コメント 2 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Kuldeep2822k/cli#522 ·
メンテナーはふだん 1 日以内に返信
-
bug tests
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Kuldeep2822k/cli#504 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Dependency Dashboardオープンci dependencies security
難易度 4/5 3〜5日 初心者へのやさしさ 8/100
Kuldeep2822k/cli#463 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
Kuldeep2822k/cli の issue をすべて見る
似ている issue
-
documentation good first issue roadmap
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
resend/react-email#3876 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
siyuan-note/siyuan#21324 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
dmno-dev/varlock#1279 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
himynameisdave/bsky-profanity-counter#59 ·
メンテナーはふだん 1 日以内に返信