[] Create MDX content skeleton: _meta.json hierarchy and placeholder pages with frontmatter (with validation tests)#282
Conversation
…der pages with frontmatter (with validation tests)
There was a problem hiding this comment.
🍊 Orange Codens レビュー
このPRは要件通りにMDXコンテンツ骨格と検証テストを追加しており、全体的な品質は問題ないレベルです。ただし metaKeyResolvesToFile がディレクトリ存在のみで検証を通過させるロジック上の穴(index.mdx なしのディレクトリを見落とす)と、CRLF 改行環境でフロントマター検出が失敗する正規表現の問題はテストの信頼性を損なうため修正を推奨します。その他は命名不一致・マジックナンバー等のマイナーな改善点です。
🔒 セキュリティ: このPRはドキュメントサイトのMDXスケルトンとVitest検証テストを追加するものであり、サーバーサイドロジックや認証・認可コードは含まれていません。主なセキュリティ上の注意点は、テストコード内の metaKeyResolvesToFile 関数が _meta.json のキーをサニタイズせずに path.join へ渡している点です(CWE-22)。テストコードであるためseverityはlowですが、CI環境で外部から持ち込まれた _meta.json を処理するシナリオではキーの検証ガードを追加することを推奨します。その他の変更(MDXコンテンツ・設定ファイル)にはセキュリティリスクは見当たりません。
🟡 medium: 2 / 🔵 low: 4 / ⚪ info: 1
その他の指摘 (7 件)
- 🟡 [medium]
docs/__tests__/meta-validation.test.ts:37—metaKeyResolvesToFileがディレクトリ存在のみでtrueを返すため、index.mdxが無いディレクトリでも検証を通過してしまう (confidence: 0.85,code.logic.loose_meta_resolution) - 🟡 [medium]
docs/__tests__/meta-validation.test.ts:49—hasTitleFrontmatterの正規表現が Windows 改行 (\r\n) を持つファイルで失敗する (confidence: 0.82,code.regex.frontmatter_pattern_fragile) - 🔵 [low]
docs/__tests__/meta-validation.test.ts:84— 「最低 10 ページ」のマジックナンバーにコメントがなく、ページ追加時に閾値更新が漏れる (confidence: 0.75,maintainability.test.magic_number) - 🔵 [low]
docs/pages/self-hosting/index.mdx:2—self-hosting/index.mdxのtitleフロントマターが_meta.jsonのラベルと不一致 (confidence: 0.72,maintainability.naming.title_mismatch) - 🔵 [low]
docs/vitest.config.ts:1—vitest.config.tsにincludeパターンが未指定で、pages/以下の MDX もスキャン対象になりうる (confidence: 0.65,maintainability.config.no_include_pattern) - 🔵 [low]
docs/__tests__/meta-validation.test.ts:6— テストコード内でのパストラバーサルチェック欠如 (_meta.json キーのサニタイズなし) (confidence: 0.60,sec.sast.path_traversal.test_file_traversal) - ⚪ [info]
docs/public/robots.txt:1— robots.txt がすべてのクローラーにすべてのパスを許可している (confidence: 0.40,sec.sast.info.robots_txt_allow_all)
head: 333f1f1 | Orange Codens (P1)
# Conflicts: # docs/vitest.config.ts
- Convert _meta.json -> _meta.ts (Nextra 3.3.1 removed _meta.json support)
- Add required pages/_app.tsx for Nextra v3 Pages Router
- Rename pages/api -> pages/api-reference (pages/api is reserved by Next.js)
- Update meta-validation test to validate _meta.{ts,js} via import
There was a problem hiding this comment.
🍊 Orange Codens レビュー
MDX スケルトンと meta 検証テストの骨格は整っていますが、metaKeyResolvesToFile が空ディレクトリのみでも pass するため、ナビゲーション整合性テストとしての信頼性が低い点が主な懸念です。加えて、タスク仕様の api/_meta.json と実装の api-reference/_meta.ts に差分があるため、意図的な変更かどうかの確認を推奨します。
🔒 セキュリティ: 本 PR は Nextra 向けの静的 MDX ドキュメント骨格、ナビゲーション用 _meta.ts、および _meta / frontmatter を検証する Vitest テストの追加のみです。ユーザー入力を処理する API・認可ロジック・外部 URL 取得・暗号処理・動的 SQL/コマンド実行は diff に含まれておらず、OWASP Top 10 / CWE Top 25 に該当する論理的脆弱性は検出されませんでした。robots.txt の Allow: / は公開ドキュメントサイトとして一般的な設定です。
🟡 medium: 2 / 🔵 low: 2 / ⚪ info: 1
その他の指摘 (5 件)
- 🟡 [medium]
docs/__tests__/meta-validation.test.ts:48— meta 検証が空ディレクトリのみでも pass する (confidence: 0.95,code.test.weak-assertion) - 🟡 [medium]
docs/pages/_meta.ts:5— タスク仕様のapiキーがapi-referenceに変更されている (confidence: 0.90,maintainability.spec-deviation) - 🔵 [low]
docs/__tests__/meta-validation.test.ts:16— テストが_meta.jsonを走査対象から除外している (confidence: 0.85,maintainability.spec-deviation) - 🔵 [low]
docs/__tests__/meta-validation.test.ts:56—titlefrontmatter の存在のみ検証し値の妥当性は未チェック (confidence: 0.75,maintainability.test-coverage) - ⚪ [info]
docs/pages/_meta.ts:1— タスク仕様の_meta.jsonが_meta.tsとして実装されている (confidence: 0.80,maintainability.spec-deviation)
head: 4dfd3b4 | Orange Codens (P1)
- Take main's docs/tsconfig.json (PR's types override broke next build's type-checking of nextra theme config) - Drop standalone 'tsc --noEmit' step (impossible in monorepo: parent tsconfig excludes docs; next build already type-checks) - Fix lychee args: --root-dir + --fallback-extensions html for static export, exclude 404 page (intentional /docs link per main's test) - Fix EditPageLink: docsRepositoryBase is undefined via useConfig in nextra v3 -> broken edit links on every page - Fix /LICENSE link in contributing/index.mdx (repo-root file absent in static site) -> point to GitHub - Remove stale pre-#282 scaffold (pages/index.tsx duplicate of index.mdx, pages/content/intro.mdx)
…tmatter validation, Pagefind index (#261) * chore: Add CI pipeline for docs site: static build, dead-link check, frontmatter validation, Pagefind index * chore: Add CI pipeline for docs site: static build, dead-link check, frontmatter validation, Pagefind index * ci(docs): reconcile docs CI job to be green on current main - Take main's docs/tsconfig.json (PR's types override broke next build's type-checking of nextra theme config) - Drop standalone 'tsc --noEmit' step (impossible in monorepo: parent tsconfig excludes docs; next build already type-checks) - Fix lychee args: --root-dir + --fallback-extensions html for static export, exclude 404 page (intentional /docs link per main's test) - Fix EditPageLink: docsRepositoryBase is undefined via useConfig in nextra v3 -> broken edit links on every page - Fix /LICENSE link in contributing/index.mdx (repo-root file absent in static site) -> point to GitHub - Remove stale pre-#282 scaffold (pages/index.tsx duplicate of index.mdx, pages/content/intro.mdx) --------- Co-authored-by: codens-agent <agent@codens.ai> Co-authored-by: red-codens[bot] <245102073+red-codens[bot]@users.noreply.github.com> Co-authored-by: zoetaka38 <takayuki.kawazoe@corevice.com> Co-authored-by: zoetaka38 <tkawazoe@portament.jp>
Summary
Type of Change
Testing
Checklist
Task Goal
Target Repository
Corevice/open-gitAll work for this task belongs in this repository. Do the implementation inside this repository's directory in the workspace; do not search or edit other repositories unless this task explicitly requires a cross-repo change.
Context
With the Nextra scaffold in place, populate the
pages/directory with the navigation structure and placeholder MDX files. Each file must have the requiredtitlefrontmatter. Also add a Vitest test that validates all_meta.jsonentries point to real files and all MDX files contain atitlefield.Steps
open-git/docs/pages/_meta.json:{ "index": "ホーム", "getting-started": "はじめに", "self-hosting": "セルフホスト", "api": "API リファレンス", "contributing": "コントリビューター" }open-git/docs/pages/index.mdxwith frontmattertitle: ホーム,description: open-git 公式ドキュメント; body: heading, intro paragraph, links to getting-startedopen-git/docs/pages/getting-started/_meta.json→{ "index": "概要", "installation": "インストール", "quickstart": "クイックスタート" }open-git/docs/pages/getting-started/index.mdxwithtitle: はじめにopen-git/docs/pages/getting-started/installation.mdxwithtitle: インストール,order: 1— Docker Compose and Helm install placeholder sectionsopen-git/docs/pages/getting-started/quickstart.mdxwithtitle: クイックスタート,order: 2open-git/docs/pages/self-hosting/_meta.json→{ "index": "概要", "traefik": "Traefik 設定", "database": "データベース" }open-git/docs/pages/api/_meta.json→{ "rest": "REST API", "graphql": "GraphQL API" }open-git/docs/pages/contributing/_meta.json→{ "index": "コントリビューターガイド", "license": "ライセンス", "branding": "ブランディング" }Changes Made
I'll
inspect
the existing
docs layout
,
then add the navigation
structure
, MD
X placeholders
, Vit
est config, and
validation
test
.
Creating the pages
structure
, MD
X stubs, Vit
est config, and
validation
test
.
N
extra
docs
scaffold is
in
place: navigation
, placeholder
MDX pages,
Vitest config,
and meta
validation tests.
**
Navigation structure
**
-level
_ meta.jsonwith 5 sections
(ホ
ーム, はじ
めに,
セルフホ
スト, API
リファレ
ンス, コ
ントリビュ
ーター)
Sub-section
s for
getting-started, self
-hosting, api
, and contributing
**Content
(
12 MDX pages
)
**
Home
page
with intro
and links to getting
-started
Getting
Started
: overview
, installation (
Docker Compose /
Helm placeholders), quick
start
Self
-host
ing: overview,
Traefik, database
API
: REST and Graph
QL stubs
Contributing:
guide
(
links
to LICENSE), license
, branding
**Infrastructure
**
public/robots .txt—allows all crawlers
vit est.config.ts— node
environment
__tests__/meta -validation.test.ts— validates
_meta .jsonentriesresolve to files,
all MDX have
titlefrontmatter, and
at least 10
MDX pages exist
[P
URPLE-M
ODIFIED-FILES
]
docs/pages/_
meta.json
docs
/pages/index.mdx
docs/pages/getting
-started/_meta.json
docs/pages/getting
-started/index.mdx
docs/pages/getting
-started/installation.md
x
docs/pages
/getting-started/quickstart
.mdx
docs
/pages/
self-hosting/_
meta.json
docs
/pages/self-host
ing/index.mdx
docs/pages/
self-hosting/
traefik.mdx
docs/pages/
self-hosting/database
.mdx
docs
/pages/api/_meta
.json
docs/pages
/api/rest.mdx
docs/pages/api
/graphql.mdx
docs/pages/contributing
/_meta.json
docs/pages/contributing
/index.mdx
docs/pages/contributing
/license.mdx
docs/pages/contributing
/branding.mdx
docs/public
/robots.txt
docs/v
itest.config.ts
docs/__tests
__/meta-validation.test
.ts
[/
PURPLE
-MODIFIED-F
ILES]
Task ID:
019f0d7d-8800-7bb4-ad40-8d5d0a86fc80Generated by Purple Codens