get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2197153/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2197153,
    "url": "http://patchwork.ozlabs.org/api/patches/2197153/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/ltp/patch/20260217-agents_file-v3-1-fc2e6f97e0a7@suse.com/",
    "project": {
        "id": 59,
        "url": "http://patchwork.ozlabs.org/api/projects/59/?format=api",
        "name": "Linux Test Project development",
        "link_name": "ltp",
        "list_id": "ltp.lists.linux.it",
        "list_email": "ltp@lists.linux.it",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260217-agents_file-v3-1-fc2e6f97e0a7@suse.com>",
    "list_archive_url": null,
    "date": "2026-02-17T08:26:54",
    "name": "[v3] agents: Add AI agent configuration for code reviews",
    "commit_ref": null,
    "pull_url": null,
    "state": "needs-review-ack",
    "archived": false,
    "hash": "b511ec40e60ff287cb8996237bb1a5af4d980938",
    "submitter": {
        "id": 83220,
        "url": "http://patchwork.ozlabs.org/api/people/83220/?format=api",
        "name": "Andrea Cervesato",
        "email": "andrea.cervesato@suse.de"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/ltp/patch/20260217-agents_file-v3-1-fc2e6f97e0a7@suse.com/mbox/",
    "series": [
        {
            "id": 492394,
            "url": "http://patchwork.ozlabs.org/api/series/492394/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/ltp/list/?series=492394",
            "date": "2026-02-17T08:26:54",
            "name": "[v3] agents: Add AI agent configuration for code reviews",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/492394/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2197153/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/2197153/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "ltp@lists.linux.it"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "ltp@picard.linux.it"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=g/t4zrnG;\n\tdkim=fail reason=\"signature verification failed\" header.d=suse.de\n header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519\n header.b=H9UtmF2F;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa\n header.b=g/t4zrnG;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=H9UtmF2F;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=213.254.12.146; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)",
            "smtp-out2.suse.de;\n\tnone"
        ],
        "Received": [
            "from picard.linux.it (picard.linux.it [213.254.12.146])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fFXnJ3zhLz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 17 Feb 2026 19:27:13 +1100 (AEDT)",
            "from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 70AFF3D05EA\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 17 Feb 2026 09:27:11 +0100 (CET)",
            "from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id D2BCD3D03A5\n for <ltp@lists.linux.it>; Tue, 17 Feb 2026 09:27:06 +0100 (CET)",
            "from smtp-out2.suse.de (smtp-out2.suse.de\n [IPv6:2a07:de40:b251:101:10:150:64:2])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-6.smtp.seeweb.it (Postfix) with ESMTPS id B68FA1400157\n for <ltp@lists.linux.it>; Tue, 17 Feb 2026 09:27:04 +0100 (CET)",
            "from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-out2.suse.de (Postfix) with ESMTPS id 3AC605BCF9;\n Tue, 17 Feb 2026 08:26:58 +0000 (UTC)",
            "from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 04CF03EA65;\n Tue, 17 Feb 2026 08:26:57 +0000 (UTC)",
            "from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n by imap1.dmz-prg2.suse.org with ESMTPSA id yLuUOlEmlGmQWQAAD6G6ig\n (envelope-from <andrea.cervesato@suse.de>); Tue, 17 Feb 2026 08:26:57 +0000"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1771316818;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=tn5MffVdczLXED5FGO5+86w2pDYeltsAN+x1p5dcULU=;\n b=g/t4zrnGprZ0xv8qK3iv45MJETyEzrueeqqZ8mvKnnvrjG7vlbtXC1CyUoMNl+HfxkKnuN\n mRMqvMyjcAOuHBWe98k3bHOMnO4ZyaTkXdfmzb+CV/AAIZkLkNsQ9ey2+wkJ0vv2ybqNSP\n AjZ15n1CrR9IKGbWNDVFyrkrieBg2wc=",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1771316818;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=tn5MffVdczLXED5FGO5+86w2pDYeltsAN+x1p5dcULU=;\n b=H9UtmF2F56Vxi+/RHKvu32bRp6jfDuSYdWB3jwG3a2fdzoeblI2HM8T690gXUFwht3WRU1\n AK7nF+0mf4U8vjBg==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1771316818;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=tn5MffVdczLXED5FGO5+86w2pDYeltsAN+x1p5dcULU=;\n b=g/t4zrnGprZ0xv8qK3iv45MJETyEzrueeqqZ8mvKnnvrjG7vlbtXC1CyUoMNl+HfxkKnuN\n mRMqvMyjcAOuHBWe98k3bHOMnO4ZyaTkXdfmzb+CV/AAIZkLkNsQ9ey2+wkJ0vv2ybqNSP\n AjZ15n1CrR9IKGbWNDVFyrkrieBg2wc=",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1771316818;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=tn5MffVdczLXED5FGO5+86w2pDYeltsAN+x1p5dcULU=;\n b=H9UtmF2F56Vxi+/RHKvu32bRp6jfDuSYdWB3jwG3a2fdzoeblI2HM8T690gXUFwht3WRU1\n AK7nF+0mf4U8vjBg=="
        ],
        "From": "Andrea Cervesato <andrea.cervesato@suse.de>",
        "Date": "Tue, 17 Feb 2026 09:26:54 +0100",
        "MIME-Version": "1.0",
        "Message-Id": "<20260217-agents_file-v3-1-fc2e6f97e0a7@suse.com>",
        "X-B4-Tracking": "v=1; b=H4sIAE0mlGkC/33MywrCMBCF4VcpWRvJpQ3qyvcQkTSdaQe0lUwNS\n um7mxYE3bg8B/5vEgyRgMWhmESERExDn4fdFCJ0vm9BUpO3MMo4ZXQlfQv9yBekK0hblnUTrFW\n qUSIX9whIz1U7nfPuiMchvlY86eX9OO7HSVpqWVkIzu8goDVHfjBsw3ATC5PMn9TktHYeEUu9r\n /A7nef5DX2dv1jgAAAA",
        "X-Change-ID": "20260215-agents_file-344bdc3300d0",
        "To": "Linux Test Project <ltp@lists.linux.it>",
        "X-Mailer": "b4 0.14.2",
        "X-Developer-Signature": "v=1; a=ed25519-sha256; t=1771316817; l=16877;\n i=andrea.cervesato@suse.com; s=20251210; h=from:subject:message-id;\n bh=9TiTzFpqB3vospeIav6Iloh6Pwbj1GNyF3KmaPhQ8ks=;\n b=AEekPqjZyyzW3yHUIK3WjOV1cAibG8/hREQKdFAyFFs1qRSbDYXMr3mN1vq0W9NKQWQslWEhB\n 6/8RAwI6wHFBPHbmYk1m/Qbtdxg6yWCAtc/FkNnDzKw1McpxldwqUz4",
        "X-Developer-Key": "i=andrea.cervesato@suse.com; a=ed25519;\n pk=zKY+6GCauOiuHNZ//d8PQ/UL4jFCTKbXrzXAOQSLevI=",
        "X-Spam-Score": "-4.30",
        "X-Spamd-Result": "default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n NEURAL_HAM_LONG(-1.00)[-1.000];\n NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain];\n FUZZY_RATELIMITED(0.00)[rspamd.com];\n RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[];\n RCPT_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[];\n DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n TO_DN_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+];\n FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[];\n RCVD_COUNT_TWO(0.00)[2];\n DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:mid, suse.com:email,\n imap1.dmz-prg2.suse.org:helo]",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no\n autolearn=disabled version=4.0.1",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on in-6.smtp.seeweb.it",
        "X-Virus-Scanned": "clamav-milter 1.0.9 at in-6.smtp.seeweb.it",
        "X-Virus-Status": "Clean",
        "Subject": "[LTP] [PATCH v3] agents: Add AI agent configuration for code reviews",
        "X-BeenThere": "ltp@lists.linux.it",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Linux Test Project <ltp.lists.linux.it>",
        "List-Unsubscribe": "<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>",
        "List-Archive": "<http://lists.linux.it/pipermail/ltp/>",
        "List-Post": "<mailto:ltp@lists.linux.it>",
        "List-Help": "<mailto:ltp-request@lists.linux.it?subject=help>",
        "List-Subscribe": "<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it",
        "Sender": "\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"
    },
    "content": "From: Andrea Cervesato <andrea.cervesato@suse.com>\n\nAdd agents/ directory with configuration files for automated code review\nassistance. The configuration includes:\n\n- ground-rules.md: Mandatory LTP development rules\n- c-tests.md: C test writing guidelines and examples\n- shell-tests.md: Shell test structure and style guide\n- review.md: Review protocol for AI agents\n\nAGENTS.md at root provides project overview and links to review protocol.\n\nSigned-off-by: Andrea Cervesato <andrea.cervesato@suse.com>\n---\nChanges in v3:\n- review and fix the agents review configuration\n- Link to v2: https://lore.kernel.org/r/20260216-agents_file-v2-1-b6afff4195f2@suse.com\n\nChanges in v2:\n- rewrite the entire agents/ structure to reduce the LLM allucination\n  and to focus on reviews only\n- AGENTS.md now is defining basic project usage and it points to the\n  agents/review.md for review requests\n- Link to v1: https://lore.kernel.org/r/20260216-agents_file-v1-1-53ec6a8ecf32@suse.com\n---\n AGENTS.md              | 104 ++++++++++++++++++++++++++++++++++++++++++\n agents/c-tests.md      | 121 +++++++++++++++++++++++++++++++++++++++++++++++++\n agents/ground-rules.md |  69 ++++++++++++++++++++++++++++\n agents/review.md       |  50 ++++++++++++++++++++\n agents/shell-tests.md  |  95 ++++++++++++++++++++++++++++++++++++++\n 5 files changed, 439 insertions(+)\n\n\n---\nbase-commit: c6e1d87b8a57b2387d0248a06fbb6a468b132849\nchange-id: 20260215-agents_file-344bdc3300d0\n\nBest regards,",
    "diff": "diff --git a/AGENTS.md b/AGENTS.md\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..7698ca2bb5288d720d39d4d5de71bed8fbfc647a\n--- /dev/null\n+++ b/AGENTS.md\n@@ -0,0 +1,104 @@\n+# Linux Test Project (LTP)\n+\n+LTP delivers tests to the open source community that validate the\n+reliability, robustness, and stability of the Linux kernel and related\n+features. Tests are written in C or portable POSIX shell. The project uses\n+GNU Autotools for its build system and follows the Linux kernel coding style.\n+\n+**License**: GPL-2.0-or-later (`SPDX-License-Identifier: GPL-2.0-or-later`)\n+\n+## Technology Stack\n+\n+- **Languages**: C (primary), portable POSIX shell\n+- **Build system**: GNU Autotools (autoconf, automake, make)\n+- **Compiler**: gcc (clang also supported in CI)\n+- **Coding style**: Linux kernel coding style\n+- **Test runner**: kirk (replacing legacy `runltp`)\n+- **Documentation**: reStructuredText + Sphinx\n+\n+## Project Structure\n+\n+- `testcases/` - All test binaries (C and shell)\n+  - `testcases/kernel/syscalls/` - Syscall and libc wrapper tests\n+  - `testcases/open_posix_testsuite/` - Open POSIX testsuite fork\n+  - `testcases/lib/` - Shell test library and shell loader\n+- `include/` - LTP library headers (`tst_test.h` is the main API)\n+  - `include/lapi/` - Fallback kernel API definitions for older systems\n+  - `include/mk/` - Build system include files\n+- `lib/` - LTP C library source (`tst_*.c` files)\n+  - `lib/newlib_tests/` - LTP library self-tests\n+- `runtest/` - Runtest files defining test suites (e.g. `syscalls`, `mm`)\n+- `scenario_groups/` - Default sets of runtest files\n+- `doc/` - Sphinx documentation (RST format)\n+- `infrastructure/` - Terraform configs (if present)\n+- `scripts/` - Helper scripts\n+- `ci/` - CI dependency installation scripts\n+- `.github/workflows/` - GitHub Actions CI workflows\n+- `tools/` - Release and maintenance tools\n+- `agents/` - AI Agents configurations\n+\n+## Environment Setup\n+\n+### Prerequisites\n+\n+- git\n+- autoconf, automake, m4\n+- make\n+- gcc\n+- pkgconf / pkg-config\n+- libc headers\n+- linux headers\n+\n+### Download Source\n+\n+```sh\n+git clone --recurse-submodules https://github.com/linux-test-project/ltp.git\n+cd ltp\n+```\n+\n+### Build from Source\n+\n+```sh\n+make autotools\n+./configure\n+make\n+```\n+\n+### Install (default prefix: /opt/ltp)\n+\n+```sh\n+make install\n+```\n+\n+### Rebuild from Scratch (required after build system changes)\n+\n+```sh\n+make autotools\n+./configure\n+make\n+```\n+\n+## FILE LOADING INSTRUCTIONS\n+\n+### Code review (ALWAYS LOAD WHEN PATCH REVIEW IS REQUESTED)\n+\n+- `agents/review.md` - Entry point for the review agent\n+\n+## Additional Resources\n+\n+- Documentation: https://linux-test-project.readthedocs.io/\n+- Source code: https://github.com/linux-test-project/ltp\n+- Mailing list: https://lore.kernel.org/ltp/\n+- Patchwork: https://patchwork.ozlabs.org/project/ltp/list/\n+- Kirk (test runner): https://github.com/linux-test-project/kirk\n+- Linux kernel coding style: https://www.kernel.org/doc/html/latest/process/coding-style.html\n+\n+### Documentation\n+\n+- For full development documentation, see `doc/developers`.\n+- For full maintenance documentation, see `doc/maintenance`.\n+- For full users documentation, see `doc/users`.\n+- For detailed API reference, see `doc/developers/api_c_tests.rst` and\n+  `doc/developers/api_shell_tests.rst`.\n+- For build system details, see `doc/developers/build_system.rst`.\n+- For test writing tutorial, see `doc/developers/test_case_tutorial.rst`.\ndiff --git a/agents/c-tests.md b/agents/c-tests.md\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..dd966ec723d5182eff422339174e01e4dab66983\n--- /dev/null\n+++ b/agents/c-tests.md\n@@ -0,0 +1,121 @@\n+# C Tests\n+\n+## Test Structure\n+\n+```c\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/*\n+ * Copyright (c) YYYY Your Name <email>\n+ */\n+\n+/*\\\n+ * High-level RST-formatted test description goes here.\n+ * Explain _what_ is being tested (exported to docs).\n+ *\n+ * The following part is OPTIONAL:\n+ * [Algorithm]\n+ *\n+ * Explaination of how algorithm in the test works in a list (-) syntax.\n+ */\n+\n+#include \"tst_test.h\"\n+\n+static void run(void)\n+{\n+    tst_res(TPASS, \"Test passed\");\n+}\n+\n+static struct tst_test test = {\n+    .test_all = run,\n+};\n+```\n+\n+## Mandatory Tests Rules\n+\n+- Follow Linux kernel coding style\n+- Include `tst_test.h` as the main API header\n+- `main()` is provided by the test library; do not define it, unless\n+  `TST_NO_DEFAULT_MAIN` is used inside the test\n+- Use `struct tst_test` to configure test callbacks, requirements, and metadata\n+- Use `tst_res()` for reporting (TPASS, TFAIL, TCONF, TBROK, TINFO)\n+- Use `tst_brk()` for fatal errors that abort the test\n+- Use `SAFE_*` macros for system calls that must not fail\n+- Use `TEST()` macro to capture return value in `TST_RET` and errno in `TST_ERR`\n+- Keep handlers thin; use `.setup` and `.cleanup` callbacks\n+- Cleanup must run on all exit paths (unmount, restore sysctls, delete temp\n+  files, kill processes)\n+- Do not use the old API (`test.h`); use only the new API (`tst_test.h`)\n+- Syscall tests go under `testcases/kernel/syscalls/`\n+- Each test must have an entry in the appropriate `runtest/` file\n+- New test binaries must be added to the corresponding `.gitignore`\n+- Datafiles go in a `datafiles/` subdirectory, installed to\n+  `testcases/data/$TCID`\n+- Sub-executables use `$TESTNAME_` prefix\n+- Use `.needs_tmpdir = 1` and work in the current directory for temp files\n+- Use `.min_kver` for kernel version gating; prefer runtime checks over\n+  compile-time checks\n+- Return `TCONF` when a feature is unavailable (not `TFAIL`)\n+- If a test is a regression test it should include `.tags` in the\n+  `struct tst_test` definition\n+\n+## Code Pattern Examples\n+\n+### ✅ Good Code (New API)\n+\n+```c\n+#include <stdlib.h>\n+#include \"tst_test.h\"\n+\n+static int fd;\n+\n+static void setup(void)\n+{\n+    // SAFE macro aborts test if it fails\n+    fd = SAFE_OPEN(\"test_file\", O_RDWR | O_CREAT, 0644);\n+}\n+\n+static void cleanup(void)\n+{\n+    if (fd > 0)\n+        SAFE_CLOSE(fd);\n+}\n+\n+static void run(void)\n+{\n+    if (write(fd, \"a\", 1) != 1) {\n+        tst_res(TFAIL | TERRNO, \"write() failed\");\n+        return;\n+    }\n+    tst_res(TPASS, \"write() succeeded\");\n+}\n+\n+static struct tst_test test = {\n+    .test_all = run,\n+    .setup = setup,\n+    .cleanup = cleanup,\n+    .needs_tmpdir = 1,\n+    .needs_root = 1,\n+};\n+\n+```\n+\n+### ❌ Bad Code (Legacy/Unsafe)\n+\n+```c\n+/* WRONG HEADER */\n+#include <stdio.h>\n+#include \"test.h\"\n+\n+int main(void) /* WRONG: NO MAIN ALLOWED */\n+{\n+    int fd = open(\"/tmp/file\", O_RDWR); /* WRONG: UNSAFE & HARDCODED PATH */\n+\n+    if (fd < 0) {\n+        perror(\"open\"); /* WRONG: USE tst_res OR SAFE_MACRO */\n+        exit(1);\n+    }\n+\n+    tst_resm(TPASS, \"test passed\"); /* WRONG: OLD PRINT FUNCTION */\n+    tst_exit();\n+}\n+```\ndiff --git a/agents/ground-rules.md b/agents/ground-rules.md\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..b6c1e0ba87a2f2be2a3603d1b904e8dcb25e51c9\n--- /dev/null\n+++ b/agents/ground-rules.md\n@@ -0,0 +1,69 @@\n+# Ground Rules\n+\n+These rules are **mandatory** and must never be violated when writing or\n+modifying LTP code.\n+\n+## No kernel bug workarounds\n+\n+Never work around a known kernel bug in LTP test code. Workarounds mask\n+failures for everyone else. If a test fails because a fix was not backported,\n+that is the expected (correct) result.\n+\n+## No sleep-based synchronization\n+\n+Never use `sleep()` to synchronize between processes. It causes rare flaky\n+failures, wastes CI time, and breaks under load. Use instead:\n+\n+- `waitpid()/SAFE_WAITPID()` — when parent just needs child to finish\n+- `TST_CHECKPOINT_WAIT()` / `TST_CHECKPOINT_WAKE()` — when child must reach a\n+  code point before parent continues (futex-based, shared memory)\n+- `TST_PROCESS_STATE_WAIT()` — when child must be sleeping in a syscall\n+  (polls `/proc/$PID/stat`)\n+- Exponential-backoff polling loop — for async or deferred kernel actions\n+\n+## Runtime feature detection only\n+\n+Compile-time checks (`configure.ac`) may only enable fallback API definitions\n+in `include/lapi/`. Never assume compile-time results reflect the running\n+kernel. At runtime use: errno checks (`ENOSYS` / `EINVAL`), `.min_kver`,\n+`.needs_kconfigs`, or kernel `.config` parsing.\n+\n+## Minimize root usage\n+\n+Do not require root unless the test truly needs it. If root is needed,\n+document _why_ in the test's doc comment. Drop privileges for sections that\n+do not need them.\n+\n+## Always clean up\n+\n+Every test must leave the system exactly as it found it, even on failure or\n+early exit. Unmount filesystems, restore sysctls and `/proc`/`/sys` values,\n+delete temp files/dirs, kill spawned processes, remove cgroups/namespaces,\n+detach loop devices, restore ulimits. Prefer library helpers:\n+`.needs_tmpdir`, `.save_restore`, `.needs_device`, `.restore_wallclock`,\n+`.needs_cgroup_ctrls`.\n+\n+## Write portable code\n+\n+- No nonstandard libc APIs when a portable equivalent exists\n+- No assumptions about 64-bit, page size, endianness, or tool versions\n+- Architecture-specific tests must still compile everywhere; gate with\n+  `.supported_archs`\n+- Shell tests must be portable POSIX shell (no bash-isms); verify with\n+  `make check`\n+\n+## One logical change per patch\n+\n+Split work into small, well-defined patches. Each patch must:\n+\n+- compile successfully on its own\n+- keep all tests and tooling functional\n+- not introduce intermediate breakage\n+- have a clear commit message explaining the change\n+  Patches mixing unrelated changes will be delayed or ignored.\n+\n+## Unreleased kernel features\n+\n+Tests for features not yet in a mainline kernel release use the `[STAGING]`\n+subject prefix and go into `runtest/staging` only. They will not be merged\n+into default test suites until the kernel code is finalized and released.\ndiff --git a/agents/review.md b/agents/review.md\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..143aef5056023a9dd9314cdb56b60d62170c6ec5\n--- /dev/null\n+++ b/agents/review.md\n@@ -0,0 +1,50 @@\n+# LTP Patch Review Protocol\n+\n+You are an agent that performs a deep regression analysis on patches for the\n+LTP - Linux Test Project.\n+\n+The review must be requested for one of the following:\n+\n+- Git commit\n+- Git branch\n+- Multiple git commits\n+- URL to patchwork\n+- URL to lore\n+- Local patches file\n+\n+## Core Files (ALWAYS LOAD FIRST)\n+\n+1. `ground-rules.md` - Consolidate the rules for LTP tests\n+\n+## Review Git Commit\n+\n+- Commits must include `Signed-off-by:` tag\n+- Commit messages must be clear, following kernel commit style\n+- Use `[STAGING]` subject prefix for tests targeting unreleased kernel features\n+- `Fixes: hash` if it fixes particular LTP commit\n+- `Fixes: #N` if it fixes github issue number N, so it's automatically closed\n+\n+## Review C Tests\n+\n+- Always load `c-tests.md` before starting the review and make sure that tests\n+  follow all the rules\n+- Compare syscall usage with man pages and kernel code\n+\n+### C Tests Contribution Checklist (ALL MUST PASS)\n+\n+- Patches apply cleanly over latest git\n+- Test compiles and runs fine (check with `-i 10` and `-i 0` too)\n+- Runtest entries are in place\n+- New test binaries are added to corresponding `.gitignore` files\n+- Run `make check` or `make check-$TCID` in the test directory (uses vendored\n+  `checkpatch.pl` from kernel tree)\n+\n+## Review Shell Tests\n+\n+Always load `shell-tests.md` before starting the review.\n+\n+### Shell Tests Contribution Checklist (ALL MUST PASS)\n+\n+- Patches apply cleanly over latest git\n+- Make sure that shell tests rules are applied\n+- `make check` emits no warnings for your test\ndiff --git a/agents/shell-tests.md b/agents/shell-tests.md\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..0a93b54bddec9531e9a17291b5b8c2a9e525a540\n--- /dev/null\n+++ b/agents/shell-tests.md\n@@ -0,0 +1,95 @@\n+# Shell Test API\n+\n+## Mandatory file structure\n+\n+Every shell test must follow this exact layout, in order. Omitting or\n+reordering these blocks will break the shell loader.\n+\n+```sh\n+#!/bin/sh\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+# Copyright (c) YYYY Author Name <email@example.org>\n+# ---\n+# doc\n+# Brief RST description of what the test verifies.\n+#\n+# Additional detail if needed (exported to generated docs).\n+# ---\n+# ---\n+# env\n+# {\n+#  \"needs_root\": true,\n+#  \"needs_tmpdir\": true\n+# }\n+# ---\n+\n+TST_SETUP=setup\n+TST_CLEANUP=cleanup\n+\n+. tst_loader.sh\n+\n+setup()\n+{\n+    tst_res TINFO \"setup executed\"\n+}\n+\n+cleanup()\n+{\n+    tst_res TINFO \"cleanup executed\"\n+}\n+\n+tst_test()\n+{\n+    tst_res TPASS \"Test passed\"\n+}\n+\n+. tst_run.sh\n+```\n+\n+## Block-by-block rules\n+\n+1. **Shebang + license + copyright** — always `#!/bin/sh`, always\n+   `GPL-2.0-or-later`.\n+2. **`# --- doc`** block — RST-formatted comment describing _what_ is tested.\n+   Parsed and exported to the online test catalog. Must be present.\n+3. **`# --- env`** block — JSON serialization of `struct tst_test` fields.\n+   Must be present even when empty (`{}`). Keys map nearly 1:1 to the C\n+   struct (e.g. `\"needs_root\": true`, `\"needs_tmpdir\": true`,\n+   `\"needs_kconfigs\": [\"CONFIG_NUMA=y\"]`, `\"tags\": {[\"linux-git\", \"<hash>\"]}`).\n+4. **`TST_SETUP` / `TST_CLEANUP` variables** — set _before_ sourcing\n+   `tst_loader.sh`. Optional. Setup runs once before tests; cleanup runs\n+   once after tests or on `tst_brk` interruption.\n+5. **`. tst_loader.sh`** — sources the shell loader, which internally\n+   launches `tst_run_shell.c` to parse the env block and initialize the C\n+   test library. Must come after variable assignments and before function\n+   definitions.\n+6. **`setup()` / `cleanup()` functions** — defined after the loader is\n+   sourced. Names must match the variables set above.\n+7. **`tst_test()` function** — the actual test logic. Report results with\n+   `tst_res` and `tst_brk`. Results are stored in shared memory so child\n+   processes do not need to propagate them.\n+8. **`. tst_run.sh`** — must be the very last line. Triggers test execution.\n+\n+## Shell coding style\n+\n+- **Portable POSIX shell only** — no bash-isms (no `[[ ]]`, no arrays,\n+  no `function` keyword, no process substitution)\n+- Allowed exceptions: `local` keyword inside functions, `-o` and `-a` test\n+  operators\n+- Code must support also `dash`\n+- Keep lines under 80 characters\n+- Use tabs for indentation\n+- Quote all variable expansions\n+- Avoid unnecessary subshells\n+- Do not name functions after common shell commands\n+\n+## Running shell tests from the source tree\n+\n+```sh\n+# From the test's directory (depth may vary)\n+PATH=$PATH:$PWD:$PWD/../../lib/ ./foo01.sh\n+```\n+\n+The `../../lib/` path must point to `testcases/lib/` where `tst_loader.sh`,\n+`tst_run.sh`, and the compiled `tst_run_shell` binary reside. Adjust the\n+number of `../` segments to match the test's depth relative to `testcases/`.\n",
    "prefixes": [
        "v3"
    ]
}