Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion apps/aam-cli/src/aam_cli/commands/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ def _print_verbose_workaround(console: Console, warning: str) -> None:
warning_lower = warning.lower()

for key, workaround in VERBOSE_WORKAROUNDS.items():
if key.replace("_", " ").replace("removed", "").strip() in warning_lower:
normalized_key = (
key.replace("_", " ")
.replace("removed", "")
.strip()
.lower()
)
if normalized_key and normalized_key in warning_lower:
Comment on lines 220 to +227
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workaround matching is still brittle because it relies on the (normalized) workaround dict key being a substring of the warning text. Several current pairs don’t match (e.g., globs_lost vs "Glob-scoped instruction converted…", user_invokable_removed vs "user-invokable flag removed.", mcp_servers_removed vs "MCP server configuration…"). Consider standardizing warnings to include a stable token/id, or mapping explicit substrings/regexes instead of deriving from the key name.

Copilot uses AI. Check for mistakes.
console.print(f" [dim]{workaround}[/dim]")
return
21 changes: 16 additions & 5 deletions apps/aam-cli/src/aam_cli/converters/frontmatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,24 @@ def parse_frontmatter(text: str) -> tuple[dict[str, Any], str]:
if not stripped.startswith("---"):
return {}, text

# Find the closing ---
end_idx = stripped.find("---", 3)
if end_idx == -1:
# Split into lines and find the closing '---' on its own line
lines = stripped.splitlines(keepends=True)
if not lines:
return {}, text

yaml_block = stripped[3:end_idx].strip()
body = stripped[end_idx + 3:].lstrip("\n")
closing_idx: int | None = None
for i, line in enumerate(lines[1:], start=1):
if line.strip() == "---":
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The closing frontmatter delimiter check uses line.strip() == "---", which will also treat indented --- lines (e.g., inside a YAML literal block) as a delimiter and truncate parsing. Delimiters should only match when --- starts at column 0 (optionally with trailing whitespace/newline).

Suggested change
if line.strip() == "---":
# Match closing delimiter only when '---' starts at column 0
# and is followed only by optional whitespace/newline.
if line.startswith("---") and line[3:].strip() == "":

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new line-by-line delimiter scan changes parsing behavior but there’s no unit test covering the previously-broken case (e.g., a YAML value containing --- that should not terminate frontmatter). Adding a regression test would help prevent this from reappearing.

Suggested change
if line.strip() == "---":
# Only treat '---' as a closing delimiter when it appears at the start
# of the line (column 0) with no other non-whitespace characters.
if line.startswith("---") and line.strip() == "---":

Copilot uses AI. Check for mistakes.
closing_idx = i
break

if closing_idx is None:
return {}, text

# YAML block is everything between the opening and closing delimiters
yaml_block = "".join(lines[1:closing_idx]).strip()
# Body is everything after the closing delimiter
body = "".join(lines[closing_idx + 1:]).lstrip("\n")
Comment on lines +72 to +73
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lstrip("\n") will leave a leading \r when parsing files with CRLF line endings, so body can start with \r\n. Consider stripping both \r and \n here (and keep behavior consistent across platforms).

Copilot uses AI. Check for mistakes.

try:
frontmatter = yaml.safe_load(yaml_block)
Expand Down
1 change: 1 addition & 0 deletions docs/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ Detection patterns:
─ instructions/*.md (AAM convention)
─ .cursor/rules/*.mdc (Cursor rules, excluding agent-* rules)
─ CLAUDE.md (Claude instructions)
─ .github/copilot-instructions.md (Copilot legacy instructions)
─ .github/instructions/*.instructions.md (Copilot instructions)
─ AGENTS.md (Codex instructions)
```
Expand Down
2 changes: 1 addition & 1 deletion docs/user_docs/docs/mcp/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ flowchart LR
IDE["IDE / AI Agent<br/>(Cursor, Claude Desktop, etc.)"] -->|MCP protocol| AAM["AAM MCP Server<br/>(aam mcp serve)"]
AAM -->|reads/writes| Config["~/.aam/config.yaml"]
AAM -->|manages| Packages["~/.aam/packages/"]
AAM -->|clones/fetches| Sources["~/.aam/sources-cache/"]
AAM -->|clones/fetches| Sources["~/.aam/cache/git/"]

style IDE fill:#e3f2fd
style AAM fill:#f3e5f5
Expand Down
2 changes: 1 addition & 1 deletion docs/user_docs/docs/platforms/copilot.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ scope: project
---
name: python-standards
description: "Python coding standards"
scope: project
applyTo: "**"
---

# Python Coding Standards
Expand Down