get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2196965,
    "url": "http://patchwork.ozlabs.org/api/patches/2196965/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/ltp/patch/20260216-agents_file-v2-1-b6afff4195f2@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": "<20260216-agents_file-v2-1-b6afff4195f2@suse.com>",
    "list_archive_url": null,
    "date": "2026-02-16T19:11:17",
    "name": "[v2] Add agents configuration for code reviews",
    "commit_ref": null,
    "pull_url": null,
    "state": "needs-review-ack",
    "archived": false,
    "hash": "8e43c490f5d126e50c51fd239e409c26d6b71712",
    "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/20260216-agents_file-v2-1-b6afff4195f2@suse.com/mbox/",
    "series": [
        {
            "id": 492342,
            "url": "http://patchwork.ozlabs.org/api/series/492342/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/ltp/list/?series=492342",
            "date": "2026-02-16T19:11:17",
            "name": "[v2] Add agents configuration for code reviews",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/492342/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2196965/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/2196965/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=msZ7ZntM;\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=f/b7Bxir;\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=msZ7ZntM;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=f/b7Bxir;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=2001:1418:10:5::2; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)",
            "smtp-out1.suse.de;\n\tnone"
        ],
        "Received": [
            "from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2])\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 4fFC791XnCz1xwF\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 17 Feb 2026 06:11:31 +1100 (AEDT)",
            "from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 21B3D3D0524\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 16 Feb 2026 20:11:29 +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))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id C2E423CEE9D\n for <ltp@lists.linux.it>; Mon, 16 Feb 2026 20:11:25 +0100 (CET)",
            "from smtp-out1.suse.de (smtp-out1.suse.de\n [IPv6:2a07:de40:b251:101:10:150:64:1])\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 1B2F61400170\n for <ltp@lists.linux.it>; Mon, 16 Feb 2026 20:11:23 +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-out1.suse.de (Postfix) with ESMTPS id 05FD73E76A;\n Mon, 16 Feb 2026 19:11:21 +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 CB2933EA62;\n Mon, 16 Feb 2026 19:11:20 +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 bmhmL9hrk2nLRgAAD6G6ig\n (envelope-from <andrea.cervesato@suse.de>); Mon, 16 Feb 2026 19:11:20 +0000"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1771269081;\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=kgJqVXyoeNS22cjHYU1/MXX7Ia1QiNXOuajGDOiMlQ0=;\n b=msZ7ZntMDB8F/tjqy4rAPt0gdl7ZwBm1RhhUmeDkv6Esbyz5Ny3W936GyttFCVykWn8QxY\n YStrart9mNNgYki07UZhEhYR7/vgqV2EFHA/r/HChIaBikLvihQruhQCDLZHP+MhpOvsN1\n TXKLo20uyFdw4gCh2HMTH18BNVmRSKc=",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1771269081;\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=kgJqVXyoeNS22cjHYU1/MXX7Ia1QiNXOuajGDOiMlQ0=;\n b=f/b7BxirEevloyie5UetN5JR6KV03hCrfoMb9QvbLIXHfBn4TQfG25siGNfsWnhjOZfNrE\n 7KQN0ScGAGkrDzCQ==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1771269081;\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=kgJqVXyoeNS22cjHYU1/MXX7Ia1QiNXOuajGDOiMlQ0=;\n b=msZ7ZntMDB8F/tjqy4rAPt0gdl7ZwBm1RhhUmeDkv6Esbyz5Ny3W936GyttFCVykWn8QxY\n YStrart9mNNgYki07UZhEhYR7/vgqV2EFHA/r/HChIaBikLvihQruhQCDLZHP+MhpOvsN1\n TXKLo20uyFdw4gCh2HMTH18BNVmRSKc=",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1771269081;\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=kgJqVXyoeNS22cjHYU1/MXX7Ia1QiNXOuajGDOiMlQ0=;\n b=f/b7BxirEevloyie5UetN5JR6KV03hCrfoMb9QvbLIXHfBn4TQfG25siGNfsWnhjOZfNrE\n 7KQN0ScGAGkrDzCQ=="
        ],
        "From": "Andrea Cervesato <andrea.cervesato@suse.de>",
        "Date": "Mon, 16 Feb 2026 20:11:17 +0100",
        "MIME-Version": "1.0",
        "Message-Id": "<20260216-agents_file-v2-1-b6afff4195f2@suse.com>",
        "X-B4-Tracking": "v=1; b=H4sIANRrk2kC/1XMywrCMBCF4VcpszaSSxvEle8hRWIyaQe0lUwNS\n sm7GwsuXP4HzrcCYyJkODYrJMzENE819K4BP7ppQEGhNmiprdSqE27AaeFLpBsK07bX4I2RMki\n oj0fCSK9NO/e1R+JlTu8Nz+q7/hz752QllOgMeusO6KPRJ34y7v18h76U8gFj1pnVpQAAAA==",
        "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=1771269080; l=17295;\n i=andrea.cervesato@suse.com; s=20251210; h=from:subject:message-id;\n bh=UIqd2jfeiD+0IjA+pyyxA3gZr9GeAmSp2VSotGz02lo=;\n b=CKKEyXhml8BNaFlOMPtVrxOKZlh2LWxr7a7PBW0A1hi9AetXrDQBiJ8wCj+opKRzMVrMDbkie\n XIS5H3rvzUCAMr4SvooQR2TMjur/iCkdgXzm8o1qHEUroX4RIaftazR",
        "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)[-1.000]; 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]",
        "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 v2] Add agents 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 configuration generated from the LTP documentation using\nClaude Code. The agents/ folder has been added in order to split agents\nconfiguration from the actual documentation and it's pointed via\nAGENTS.md file in the root folder. This is enough to use OpenCode in the\nmain LTP root folder and to start reviewing LTP code.\n\nThe code reviews (obviously) differ between models, so it's really hard\nto say what model should be used and what not. But, for sure, Claude Code\nprovides great features at a really high price. For this reason, it's\nworth to mention that the reviewiers job should be done both by\ndevelopers, before sending patches, and by reviewers, in a second\nmoment.\n\nRealy important, we should probably find an open source model alternative\nthat is \"good enough\" for our purpose.\n\nNOTE: at the moment, agents/ and doc/ folders are overlapping\ninformation, so we might start to think how to create an AGENTS.md that\ndirectly points to a re-structured doc/ folder, simplified enough so\nagents can use it as a reference, instead of having a double folder.\n\nSigned-off-by: Andrea Cervesato <andrea.cervesato@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              |  99 ++++++++++++++++++++++++++++++++++++++++\n agents/c-tests.md      | 121 +++++++++++++++++++++++++++++++++++++++++++++++++\n agents/ground-rules.md |  71 +++++++++++++++++++++++++++++\n agents/review.md       |  50 ++++++++++++++++++++\n agents/shell-tests.md  |  95 ++++++++++++++++++++++++++++++++++++++\n 5 files changed, 436 insertions(+)\n\n\n---\nbase-commit: ef0d9ed8b19b9e32dc9ee6c0a3b14983bc387fd1\nchange-id: 20260215-agents_file-344bdc3300d0\n\nBest regards,",
    "diff": "diff --git a/AGENTS.md b/AGENTS.md\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..634c0d9812c9c80297e35563870b0f350a9b5a91\n--- /dev/null\n+++ b/AGENTS.md\n@@ -0,0 +1,99 @@\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+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..b296ea8e2043568cb4a315a16a19d09f2ef774e1\n--- /dev/null\n+++ b/agents/ground-rules.md\n@@ -0,0 +1,71 @@\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.\n+That's the raw markdown, ready to copy into an AGENTS.md or any agent\n+configuration file.\ndiff --git a/agents/review.md b/agents/review.md\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..ac7cb494bc345ad354d24b66bf9112a8caaecd71\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 `c-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": [
        "v2"
    ]
}