> For the complete documentation index, see [llms.txt](https://docs.walnutai.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.walnutai.ai/core-features/gap-analysis/phase-2-missing-story-detection.md).

# Phase 2: Missing Story Detection

**Phase 2:** Missing Story Detection identifies functionality that exists in the codebase but is not documented as user stories. WalnutAI also validates existing stories to assess coverage and provides AI-driven suggestions for improving and updating them. In this phase, the code acts as the baseline, and WalnutAI detects undocumented or incomplete requirement coverage.

* **Before starting the analysis:**
  * The project must be connected to one or more repositories.
  * Ensure the repositories were properly integrated during project creation.
  * The codebase from the selected repositories will be used as the reference for comparison against existing user stories.
* **To start the analysis:**
  * Select the required **Epics** for which you want to perform the analysis and click '**Start Analysis'**
  * Select one or more connected repositories.
  * Click **Start Analysing** to begin evaluation.
* **During analysis:**
  * WalnutAI scans the selected repository and branch.
  * It compares implemented code with documented user stories.
  * It identifies functionality implemented in code but not documented as a story.
  * It detects stories that require corrections or acceptance criteria improvements.
* **After the analysis completes, the dashboard displays:**
  * **Stories Analysed** – Total number of stories reviewed.
  * **Corrections Needed** – Stories requiring refinement.
  * **Missing Stories** – Undocumented features detected from code.
  * **High Priority** – Critical missing or impacted stories.
* **In the Analysis Results section:**
  * Separate tabs for **Missing Stories** and **Corrected Stories** with respective counts.
* **Missing Stories:** Identifies functionality implemented in the code but not documented in existing user stories. Findings are categorised into **Screens** and **APIs**.
  * Users can review the identified functionality, create new user stories using **Create Story**, or remove irrelevant findings using **Dismiss**.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2F5DdnRV1QQ98Ey1xsJBh7%2FScreenshot%202026-11-20%20at%2010.19.05%E2%80%AFPM.png?alt=media&amp;token=4a7de2fd-fa86-40f9-947c-dee52f949f97" alt=""><figcaption></figcaption></figure>

* **Corrected Stories:** Displays existing user stories where the requirements differ from the actual code implementation. WalnutAI identifies the gaps and suggests updates to align the stories with the implemented functionality.
  * **Apply Correction:** Apply the suggested changes to the selected user stories.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FeekcIqdFJu2jQJk3BakS%2FScreenshot%202026-11-20%20at%2010.19.00%E2%80%AFPM.png?alt=media&amp;token=6ce720ad-ec48-4931-80e8-14c4e682e4a7" alt=""><figcaption></figcaption></figure>

* Click **Run Analysis** to scan the updated codebase and user stories again, ensuring newly implemented features and recent changes are reflected in the analysis results

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FsjuTiOLYp4dgdBp60Wtu%2FScreenshot%202026-11-20%20at%2010.17.00%E2%80%AFPM.png?alt=media&amp;token=53e45d19-70f7-449f-90bb-8a060e98c6d4" alt=""><figcaption></figcaption></figure>

Phase 2 ensures implemented features are fully documented, improves requirement and acceptance criteria quality, maintains code-to-requirement traceability, and keeps documentation aligned with actual system behaviour while preventing undocumented development.
