From f0dea0cedc39e1be01228cca70401f58e623455d Mon Sep 17 00:00:00 2001 From: Andraxion Date: Wed, 29 Jul 2026 15:10:47 -0400 Subject: [PATCH] Document generated command surface --- docs/COMMAND_REFERENCE.md | 6 ++++++ src/docforge/command_reference.py | 6 ++++++ tests/test_command_reference.py | 3 +++ tests/test_command_reference_tool.py | 2 ++ 4 files changed, 17 insertions(+) diff --git a/docs/COMMAND_REFERENCE.md b/docs/COMMAND_REFERENCE.md index 8b2d4ca..fbd01ff 100644 --- a/docs/COMMAND_REFERENCE.md +++ b/docs/COMMAND_REFERENCE.md @@ -1,3 +1,9 @@ +# DocForge command reference + +> Generated from the live CLI parser and MCP registrations. Do not edit this file by hand. + +Global CLI options are documented in `docforge --help` and are not repeated in each command row. The MCP table is the complete generic application-enabled surface; the fixed reference-adapter server exposes only its read rows. + ## CLI commands | Command | Invocation | diff --git a/src/docforge/command_reference.py b/src/docforge/command_reference.py index 028687b..909422e 100644 --- a/src/docforge/command_reference.py +++ b/src/docforge/command_reference.py @@ -143,6 +143,12 @@ def render_command_reference_markdown( """Render the complete deterministic CLI and MCP command reference.""" return ( + "# DocForge command reference\n\n" + "> Generated from the live CLI parser and MCP registrations. Do not edit this file " + "by hand.\n\n" + "Global CLI options are documented in `docforge --help` and are not repeated in each " + "command row. The MCP table is the complete generic application-enabled surface; " + "the fixed reference-adapter server exposes only its read rows.\n\n" "## CLI commands\n\n" f"{render_cli_reference_markdown(cli_references)}" "\n## MCP tools\n\n" diff --git a/tests/test_command_reference.py b/tests/test_command_reference.py index fd229bf..e0f1741 100644 --- a/tests/test_command_reference.py +++ b/tests/test_command_reference.py @@ -113,6 +113,9 @@ class CommandReferenceTests(unittest.IsolatedAsyncioTestCase): ) self.assertEqual(1, complete.count("## CLI commands")) self.assertEqual(1, complete.count("## MCP tools")) + self.assertTrue(complete.startswith("# DocForge command reference\n")) + self.assertIn("Do not edit this file by hand.", complete) + self.assertIn("fixed reference-adapter server exposes only its read rows", complete) def test_mcp_reference_fails_closed_on_registration_drift(self) -> None: known = Tool( diff --git a/tests/test_command_reference_tool.py b/tests/test_command_reference_tool.py index 57d88f7..6498087 100644 --- a/tests/test_command_reference_tool.py +++ b/tests/test_command_reference_tool.py @@ -59,6 +59,8 @@ class CommandReferenceToolTests(unittest.TestCase): self.assertEqual(before, middle) self.assertEqual(before, _tree_snapshot(ALPHA)) self.assertTrue(first.endswith(b"\n")) + self.assertTrue(first.startswith(b"# DocForge command reference\n")) + self.assertIn(b"Do not edit this file by hand.", first) self.assertEqual(1, first.count(b"## CLI commands")) self.assertEqual(1, first.count(b"## MCP tools"))