CTF ワークスペースの状態モデルと Writeup エクスポートを追加#20
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5d54828c1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| listItems( | ||
| workspace.operations.map( | ||
| (operation) => | ||
| `**${operation.name}** (${operation.status}, ${formatDateTime(operation.executedAt)})\n - Input: ${normalizeLines(operation.inputSummary)}\n - Output: ${normalizeLines(operation.outputSummary)}\n - Notes: ${normalizeLines(operation.notes)}` |
There was a problem hiding this comment.
Sort exported steps chronologically
When a user records multiple operations, appendCtfOperation prepends each new item to workspace.operations, so mapping this array directly exports the writeup's ## Steps in reverse order. For example, adding reconnaissance and then exploitation will produce a writeup that lists exploitation before reconnaissance, which makes the exported solution misleading; sort by executedAt or reverse the array for the writeup while keeping the UI history order if desired.
Useful? React with 👍 / 👎.
|
確認しましたが、この PR は現状マージしません。 理由:
対応案:
|
# Conflicts: # src/features/ctf/types.ts # src/pages/CtfPage.tsx
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5cd24d35dc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| listItems( | ||
| chronologicalOperations.map( | ||
| (operation) => | ||
| `**${operation.name}** (${operation.status}, ${formatDateTime(operation.executedAt)})\n - Input: ${normalizeLines(operation.inputSummary)}\n - Output: ${normalizeLines(operation.outputSummary)}\n - Notes: ${normalizeLines(operation.notes)}` |
There was a problem hiding this comment.
Preserve multiline step text inside the list
When an operation summary or notes field contains line breaks (the UI uses textareas for these fields), normalizeLines preserves those newlines and this interpolation only indents the first line after Input:, Output:, or Notes:. The continuation lines are emitted at column 0, so exported Markdown breaks out of the nested step list and can turn pasted command output into unrelated paragraphs/headings instead of part of the recorded operation; indent or fence multiline values before inserting them into the list.
Useful? React with 👍 / 👎.
Motivation
Description
src/features/ctf/types.tsにCtfWorkspace/CtfArtifact/CtfOperation/CtfObservation/FlagCandidate等の型を追加し、CtfOperationに操作名・入力概要・出力概要・実行時刻・成功/失敗・メモを持たせた。src/features/ctf/history.tsにワークスペース初期化・操作生成・履歴追加・メモ更新などのヘルパー関数を追加した。src/features/ctf/writeup.tsにgenerateCtfWriteupMarkdownを追加し、Challenge/Observations/Steps/Interesting Values/Flag Candidates/Final Flagの章を出力する Markdown 生成を実装した。src/pages/CtfPage.tsxを拡張してワークスペースメモ入力、操作メモ入力フォーム、履歴表示、Writeup プレビュー、および保存ダイアログ経由での Markdown 書き出しボタンを追加した(@tauri-apps/plugin-dialogのsaveを使用)。src-tauri/src/commands/ctf.rsにwrite_ctf_writeupコマンドを追加し、src-tauri/capabilities/default.jsonにdialog:allow-saveを追記して保存許可を追加、src-tauri/src/lib.rsの invoke ハンドラにコマンドを登録した。Testing
npm run buildを実行してビルドが成功したことを確認した(成功)。npm run lintを実行して ESLint チェックが通ったことを確認した(成功)。cargo fmt --manifest-path src-tauri/Cargo.tomlを実行してフォーマットを整えた(成功)。cargo check --manifest-path src-tauri/Cargo.tomlを実行したが、ビルド環境にglib-2.0(glib-2.0.pc)がなくglib-sysのビルドスクリプトで失敗したためチェックが完了しなかった(環境依存でブロック)。Codex Task