# H4: Context Boundary Erosion

The instruction asks for unscoped context retention or leaves a detectable context boundary unclear.

<div class="rule-facts"><span>H4</span><span>MEDIUM–HIGH</span><span>LintLang 0.8.0</span></div>

**Applies to:** Recognized prompts, instructions, message sequences, and eligible disk references. Manual repair; no automatic fix for this example.

## What triggers it

Checks selected remember-everything/context language and qualified long-prompt boundary cases. Long message sequences can also lack recognized task boundaries. H4.5 is the specific missing-file diagnostic.

## How to repair it

Name what should persist and for how long. Check referenced instruction paths when files move.

## Reproduce the finding

Use [uv and Python 3.10+](/docs/install), plus curl. Run the examples in a scratch directory.

[Download the finding example](/examples/rules/h4-bad.json).

```json
{
  "system_prompt": "Remember everything from every conversation."
}
```

```sh
curl -fsS https://lintlang.ai/examples/rules/h4-bad.json -o h4-bad.json
uvx --from lintlang==0.8.0 lintlang scan h4-bad.json --format json
```

Expected with **0.8.0**: the JSON report includes **H4**, severity **HIGH**. 

## Improved example

[Download the improved example](/examples/rules/h4-improved.json).

```json
{
  "system_prompt": "Retain the invoice ID for this task only. Start each new task with an empty invoice selection."
}
```

```sh
curl -fsS https://lintlang.ai/examples/rules/h4-improved.json -o h4-improved.json
uvx --from lintlang==0.8.0 lintlang scan h4-improved.json --format json
```

Expected with **0.8.0**: **H4 is absent**. Other diagnostics may still appear; this repair targets the rule above.

Both commands use advisory mode: a finding does not itself make the command fail. To fail CI on HIGH or CRITICAL findings, add --fail-on fail. --fail-on review also gates MEDIUM. See [outputs and exit codes](/docs/outputs).

## Detection details

<details>
<summary>Released H4 detection contract and scope</summary>

Checks selected unscoped requests to remember everything or use all conversation,
history, or context; unbounded always-remember language; and, for chat prompts
only, long prompts without recognized boundary markers. It does not inspect a
host's actual context window.

H4.5 (MEDIUM; only `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `SKILL.md`, Copilot
instruction files and files with skill front matter, read from disk) reports a
referenced project file that does not exist. It needs all of: a literal relative
path with a directory part and a known file extension, in backticks or a Markdown
link, outside fenced code; a first segment that exists beside the document or at
the repository root; a path that resolves from neither; and a line that does not
talk about creating, renaming, removing or exemplifying it. It reads the
filesystem, so it does not run on standard input, and it is deliberately quiet:
directories, globs, placeholders and paths into other projects are never reported.

</details>

Related: [H4.5: Referenced project file is missing](/rules/h4.5).

[All scan rules](/rules) · [Quickstart](/docs/quickstart) · [Separate preflight checks](/docs/preflight).

