{"name": "agentmob", "version": "0.1.0", "hash": "sha256:fedf5556a93bbf0a12deb97fc83ccbdc0cb09e6b0949de3cb05928384efc14b2", "files": {"ABSORB_REPORT.md": "# Absorb report: agentmob\n\n- **Source:** https://github.com/jmondaut/AgentMob at `995d05611fd0`\n- **Licence:** AGPL-3.0 (share-alike: derived harnesses keep it)\n- **Project names searched for:** agentmob\n\n## What was absorbed\n\n| Piece | Kind | Class | Project names | Project paths |\n|---|---|---|---|---|\n| harness-retro | skill | mixed | agentmob ×1 | scripts/check-hooks.mjs, docs/HARNESS.md, docs |\n| iterate | skill | mixed | agentmob ×2 | docs/ROADMAP.md, docs/SPEC.md, docs/iterations, docs/iterations/TEMPLATE.md, src/main/core |\n| verify | skill | mixed | agentmob ×3 | scripts/verify.mjs, scripts/fake-agent.sh, docs/SPEC.md, src |\n| e2e-verifier | agent | mixed | agentmob ×3 | docs/ROADMAP.md, docs/SPEC.md, docs/iterations |\n| electron-security-reviewer | agent | mixed | agentmob ×3 | src/main, src/preload, docs/SPEC.md, scripts/check-security.mjs |\n| hooks/friction-log.mjs | hook-file | mechanics |  |  |\n| hooks/guard.mjs | hook-file | mixed | agentmob ×1 | e2e/helpers.ts |\n| hooks/security-patterns.mjs | hook-file | mixed | agentmob ×5 | scripts/check-security.mjs |\n| hooks/session-start.mjs | hook-file | mixed | agentmob ×1 | docs/ROADMAP.md, docs/SPEC.md, docs/HARNESS.md |\n| hooks/stop-gate.mjs | hook-file | mixed |  | src |\n| hooks/typecheck-on-edit.mjs | hook-file | mechanics |  |  |\n| SessionStart | hook | mechanics |  |  |\n| PreToolUse [Edit|Write|MultiEdit|Bash] | hook | mechanics |  |  |\n| PostToolUse [Edit|Write|MultiEdit] | hook | mechanics |  |  |\n| PostToolUseFailure | hook | mechanics |  |  |\n| Stop | hook | mechanics |  |  |\n| permission rules | permissions | mechanics |  |  |\n\n## Needs review before sharing\n\nThese pieces mention the project by name or lean on its files. Move those facts into configuration, or keep the piece out of a shared starter.\n\n- **harness-retro** (skill): names agentmob; paths scripts/check-hooks.mjs, docs/HARNESS.md, docs\n- **iterate** (skill): names agentmob; paths docs/ROADMAP.md, docs/SPEC.md, docs/iterations, docs/iterations/TEMPLATE.md, src/main/core\n- **verify** (skill): names agentmob; paths scripts/verify.mjs, scripts/fake-agent.sh, docs/SPEC.md, src\n- **e2e-verifier** (agent): names agentmob; paths docs/ROADMAP.md, docs/SPEC.md, docs/iterations\n- **electron-security-reviewer** (agent): names agentmob; paths src/main, src/preload, docs/SPEC.md, scripts/check-security.mjs\n- **hooks/guard.mjs** (hook-file): names agentmob; paths e2e/helpers.ts\n- **hooks/security-patterns.mjs** (hook-file): names agentmob; paths scripts/check-security.mjs\n- **hooks/session-start.mjs** (hook-file): names agentmob; paths docs/ROADMAP.md, docs/SPEC.md, docs/HARNESS.md\n- **hooks/stop-gate.mjs** (hook-file): paths src\n\n## Not absorbed\n\n- instruction files (CLAUDE.md): they describe the project, so they stay with it. Pass --with-instructions to absorb them for review\n\n## Self-test\n\n3 generated case(s) in `selftest/cases.yaml`.\n5 hook(s) were absorbed. A hook that guards something is only proven once a case shows it blocking: add `block` and `allow` cases for each, then run `baudrier selftest`.\n", "ATTRIBUTION.md": "# Attribution: agentmob\n\nThis harness was absorbed from https://github.com/jmondaut/AgentMob at commit `995d05611fd0bc9316c06ae1b966fe7bf869db21` on 2026-11-26 with `baudrier absorb`.\n\n- **Licence:** AGPL-3.0. Licence and notice files kept unchanged in this folder: `LICENSE`.\n- **Credit:** every file listed below is the work of the source repository's authors. Files were copied unchanged, except that hook commands name their folder as `${HARNESS_HOOKS}` and slash commands were wrapped as skills.\n- **Share-alike:** AGPL-3.0 requires that this harness and anything derived from it stay under the same licence, including after conversion to another agent.\n\n## Absorbed files\n\n- `skills/harness-retro/SKILL.md` (skill)\n- `skills/iterate/SKILL.md` (skill)\n- `skills/verify/SKILL.md` (skill)\n- `agents/e2e-verifier.md` (agent)\n- `agents/electron-security-reviewer.md` (agent)\n- `hooks/friction-log.mjs` (hook-file)\n- `hooks/guard.mjs` (hook-file)\n- `hooks/security-patterns.mjs` (hook-file)\n- `hooks/session-start.mjs` (hook-file)\n- `hooks/stop-gate.mjs` (hook-file)\n- `hooks/typecheck-on-edit.mjs` (hook-file)\n", "LICENSE": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<https://www.gnu.org/licenses/>.\n", "harness.yaml": "$schema: https://harnessprotocol.io/schema/v1/harness.schema.json\nversion: '1'\nkind: profile\nmetadata:\n  name: agentmob\n  description: 'Guards for an Electron app built by parallel agents: an edit and shell\n    guard, a stop gate that runs the checks, a verify loop, and a retro skill that\n    improves the harness itself.'\n  version: 0.1.0\n  license: AGPL-3.0\nskills:\n- name: harness-retro\n  source: ./skills/harness-retro\n- name: iterate\n  source: ./skills/iterate\n- name: verify\n  source: ./skills/verify\nx-agents:\n- name: e2e-verifier\n  source: ./agents/e2e-verifier.md\n- name: electron-security-reviewer\n  source: ./agents/electron-security-reviewer.md\nx-hooks:\n  runtime: claude-code\n  files: ./hooks\n  handlers:\n  - event: SessionStart\n    command: node\n    args:\n    - ${HARNESS_HOOKS}/session-start.mjs\n    timeout: 10\n  - event: PreToolUse\n    matcher: Edit|Write|MultiEdit|Bash\n    command: node\n    args:\n    - ${HARNESS_HOOKS}/guard.mjs\n    timeout: 10\n  - event: PostToolUse\n    matcher: Edit|Write|MultiEdit\n    command: node\n    args:\n    - ${HARNESS_HOOKS}/typecheck-on-edit.mjs\n    timeout: 90\n  - event: PostToolUseFailure\n    command: node\n    args:\n    - ${HARNESS_HOOKS}/friction-log.mjs\n    timeout: 10\n  - event: Stop\n    command: node\n    args:\n    - ${HARNESS_HOOKS}/stop-gate.mjs\n    timeout: 170\npermissions:\n  tools:\n    deny:\n    - Bash(tmux kill-server*)\n    - Bash(git push*)\n    - Read(~/.ssh/**)\nx-origin:\n  repository: https://github.com/jmondaut/AgentMob\n  commit: 995d05611fd0bc9316c06ae1b966fe7bf869db21\n  license: AGPL-3.0\n  license_basis: detected\n  license_files:\n  - LICENSE\n  absorbed_at: '2026-11-26'\nx-selftest: file://./selftest/cases.yaml\n", "agents/e2e-verifier.md": "---\nname: e2e-verifier\ndescription: Independently checks that an AgentMob iteration meets its \"Done when\" criteria by building, running the Electron e2e tests and inspecting screenshots. Use at the end of every iteration.\ntools: Read, Grep, Glob, Bash\nmodel: sonnet\n---\n\nYou did not write this code. Your job is to find out whether the iteration is really\ndone, not to be convinced that it is.\n\nInputs: the iteration number. Read its section in `docs/ROADMAP.md` (the \"Done when\"\nlist), `docs/SPEC.md`, and the iteration file in `docs/iterations/`.\n\n1. Build and run: `npm run -s build && npm run -s test:e2e`. Tests must use a temp repo\n   and `tmux -L agentmob-test`; if a test touches the default tmux server or a real\n   agent CLI, that's a failure in itself.\n2. For each \"Done when\" criterion, find the test or screenshot that proves it.\n   Read the screenshots in `.artifacts/screens/` and say what you actually see.\n3. A criterion with no evidence is **unmet**, even if the code looks right.\n4. Check the layout against SPEC §3: tile header shows the branch, agent pane above\n   shell pane, preview on the right, sidebar rows with status dot + eye toggle (once\n   those iterations are done).\n5. Clean up: `tmux -L agentmob-test kill-server 2>/dev/null || true`.\n\nOutput: a table `criterion · met / unmet / partial · evidence (test name or\nscreenshot + what it shows)`, then a one-line verdict: DONE or NOT DONE.\nDon't edit source files.\n", "agents/electron-security-reviewer.md": "---\nname: electron-security-reviewer\ndescription: Reviews AgentMob's Electron security surface (windows, WebContentsViews, preload, IPC, openExternal, partitions, pop-ups). Use after any change to src/main or src/preload that touches these.\ntools: Read, Grep, Glob, Bash\nmodel: sonnet\n---\n\nYou review the security of AgentMob, an Electron app that embeds arbitrary web pages\n(the per-session Preview) next to terminals that run shells on the user's Mac. A\ncompromised preview page reaching Node, IPC or the shells would be critical.\n\nRead `CLAUDE.md` (Security invariants) and `docs/SPEC.md` §6 first. Then check, citing\nfile:line for every finding:\n\n1. **webPreferences** of every BrowserWindow / WebContentsView / pop-up:\n   contextIsolation true, sandbox true, nodeIntegration false, webSecurity on, no\n   preload on preview views, partition `persist:agentmob-<sessionId>`.\n2. **Preload / contextBridge**: only small typed functions exposed. No\n   `ipcRenderer`, no generic `invoke(channel, …)`, no `electronAPI` passthrough.\n3. **IPC handlers in main**: every `ipcMain.handle/on` validates its arguments and\n   checks `event.senderFrame` belongs to the app's own renderer, not a preview.\n   A handler that writes to a pty, runs git or reads files is high risk.\n4. **Navigation**: the main window can't navigate away (`will-navigate`); previews\n   use `setWindowOpenHandler` per SPEC (max one pop-up, same partition, replace\n   policy); no `new-window` fallbacks opening real BrowserWindows.\n5. **openExternal**: only `http:`/`https:` URLs, validated with `new URL()`.\n6. **Status server**: bound to 127.0.0.1, requires the token, rejects other origins.\n7. **Terminal links**: clicking a link never executes anything; `file:`,\n   `javascript:` and custom schemes are refused.\n8. Run `node scripts/check-security.mjs` and include its result.\n\nOutput: a table `severity (critical/high/medium/low) · file:line · issue · fix`,\nthen \"No other findings.\" if that's the case. Don't edit files — report only.\n", "hooks/friction-log.mjs": "// Appends one JSON line per friction event to .artifacts/harness-log.jsonl.\n// /harness-retro reads this file to decide how the harness should evolve.\nimport { appendFileSync, mkdirSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\n\nconst root = process.env.CLAUDE_PROJECT_DIR || process.cwd();\n\nexport function logFriction(event) {\n  try {\n    const dir = join(root, \".artifacts\");\n    mkdirSync(dir, { recursive: true });\n    appendFileSync(join(dir, \"harness-log.jsonl\"),\n      JSON.stringify({ ts: new Date().toISOString(), ...event }) + \"\\n\");\n  } catch { /* logging must never break a hook */ }\n}\n\n// When run directly (PostToolUseFailure hook): log the failure, never block.\nif (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {\n  let d = \"\";\n  process.stdin.on(\"data\", (c) => (d += c));\n  process.stdin.on(\"end\", () => {\n    let e = {};\n    try { e = JSON.parse(d || \"{}\"); } catch { /* not JSON: log what we have */ }\n    const ti = e.tool_input ?? {};\n    logFriction({\n      kind: \"tool-failure\",\n      tool: e.tool_name,\n      file: ti.file_path,\n      command: typeof ti.command === \"string\" ? ti.command.slice(0, 300) : undefined,\n      error: JSON.stringify(e.error ?? e.tool_response ?? \"\").slice(0, 600),\n    });\n    process.exit(0);\n  });\n}\n", "hooks/guard.mjs": "// PreToolUse guard (Edit|Write|MultiEdit|Bash).\n// Exit 2 blocks the tool call and shows stderr to Claude.\nimport { findViolations, checkTmuxCommand } from \"./security-patterns.mjs\";\nimport { logFriction } from \"./friction-log.mjs\";\n\nconst input = JSON.parse(await new Promise((res) => {\n  let d = \"\"; process.stdin.on(\"data\", (c) => (d += c)); process.stdin.on(\"end\", () => res(d || \"{}\"));\n}));\nconst tool = input.tool_name ?? \"\";\nconst ti = input.tool_input ?? {};\n\nfunction block(reason) {\n  logFriction({ kind: \"guard-block\", tool, reason, file: ti.file_path, command: ti.command });\n  process.stderr.write(`Blocked by AgentMob harness: ${reason}\\n`);\n  process.exit(2);\n}\n\nif (tool === \"Bash\") {\n  const why = checkTmuxCommand(String(ti.command ?? \"\"));\n  if (why) block(why);\n  process.exit(0);\n}\n\n// Only scan source files, and only the text being written (not old_string).\nconst file = String(ti.file_path ?? \"\");\nif (!/\\.(m?[jt]sx?)$/.test(file) || /\\/\\.claude\\//.test(file) || /check-security\\.mjs$/.test(file)) process.exit(0);\n\nconst written = [\n  ti.content, ti.new_string,\n  ...(Array.isArray(ti.edits) ? ti.edits.map((e) => e?.new_string) : []),\n].filter((s) => typeof s === \"string\").join(\"\\n\");\n\n// Hygiene (iter-04 retro): a raw U+00A0 ended up in source twice when an escape was\n// meant; ESLint only caught it at /verify. Stop it at write time instead.\nif (written.includes(String.fromCharCode(0xa0))) {\n  block(`${file}: contains a raw non-breaking space (U+00A0). In e2e use normalizeSpaces() from e2e/helpers.ts; elsewhere build it with String.fromCharCode(0xa0).`);\n}\n\nconst violations = findViolations(written);\nif (violations.length) block(`${file}: ${violations.join(\"; \")}. If a requirement truly needs this, stop and ask the user.`);\nprocess.exit(0);\n", "hooks/security-patterns.mjs": "// Shared by the PreToolUse guard hook and scripts/check-security.mjs.\n// Each rule: a regex that must NOT appear in source code, and why.\nexport const SECURITY_RULES = [\n  { re: /nodeIntegration\\s*:\\s*true/, why: \"nodeIntegration must stay false (CLAUDE.md › Security invariants)\" },\n  { re: /nodeIntegrationInSubFrames\\s*:\\s*true/, why: \"nodeIntegrationInSubFrames must stay false\" },\n  { re: /contextIsolation\\s*:\\s*false/, why: \"contextIsolation must stay true\" },\n  { re: /sandbox\\s*:\\s*false/, why: \"sandbox must stay true for every window and view\" },\n  { re: /webSecurity\\s*:\\s*false/, why: \"webSecurity must stay on\" },\n  { re: /allowRunningInsecureContent\\s*:\\s*true/, why: \"allowRunningInsecureContent must stay off\" },\n  { re: /exposeInMainWorld\\([^)]*\\belectronAPI\\b/, why: \"don't expose @electron-toolkit's generic electronAPI; expose a small typed API instead\" },\n  { re: /exposeInMainWorld\\([\\s\\S]{0,200}?\\bipcRenderer\\s*[,}:)]/, why: \"never expose ipcRenderer itself to the renderer; wrap each channel in a typed function\" },\n];\n\n// Text that is data, not commands: heredoc bodies and quoted strings. Mentioning\n// \"tmux\" in a file being written or in an echo is not running it (iter-00 retro:\n// both guard blocks in iteration 0 were such false positives).\n// Exception: when the command hands text to another shell (`bash -c \"…\"`, `eval`,\n// `bash <<EOF`), the quoted/heredoc text IS code, so nothing is stripped.\nconst SHELL_WORD = /(^|[\\s;&|(])((ba|z|da|k)?sh|eval|source|xargs|\\.)(\\s|$)/;\nconst RUNS_QUOTED_AS_CODE = /(^|[\\s;&|(])((ba|z|da|k)?sh\\s+(-\\w+\\s+)*-c|eval|xargs)(\\s|$)/;\n// heredocs: <<EOF / <<-EOF / <<'EOF' / <<\"EOF\" … EOF\nconst HEREDOC = /<<-?\\s*(['\"]?)(\\w+)\\1([^\\n]*)\\n([\\s\\S]*?)\\n\\s*\\2\\s*(?=\\n|$)/g;\n\nexport function stripData(cmd) {\n  // 1. Heredoc bodies are data unless a shell reads them: `bash <<EOF`,\n  //    `cat <<EOF | sh`, `$(cat <<EOF)` fed to eval… — any shell word on the\n  //    heredoc's opening line keeps the body as code.\n  const noHeredocs = cmd.replace(HEREDOC, (whole, _q, _tag, restOfLine, _body, offset) => {\n    const lineStart = cmd.lastIndexOf(\"\\n\", offset) + 1;\n    const openingLine = cmd.slice(lineStart, offset) + \" \" + restOfLine;\n    return SHELL_WORD.test(openingLine) ? whole : \"<<HEREDOC\" + restOfLine;\n  });\n  // 2. Quoted strings are data unless a shell runs them (judged outside heredocs).\n  if (RUNS_QUOTED_AS_CODE.test(noHeredocs.replace(HEREDOC, \"\"))) return noHeredocs;\n  return noHeredocs\n    .replace(/'[^']*'/g, \"''\")\n    .replace(/\"(?:\\\\.|[^\"\\\\])*\"/g, '\"\"');\n}\n\nconst TMUX_RULE = \"tmux must always use AgentMob's socket: `tmux -L agentmob …` (or `-L agentmob-test` in tests). Never touch the user's default tmux server.\";\n\n// tmux commands must target AgentMob's own sockets so the user's tmux is never touched.\nexport function checkTmuxCommand(cmd) {\n  const code = stripData(cmd);\n  // tmux as a command word: start, whitespace, quote, backtick, ( or $( before it.\n  const word = /(^|[\\s;&|(\"'`])tmux(?=[\\s\"'`)]|$)/;\n  if (!word.test(code)) return null;\n  const segments = code.split(/&&|\\|\\||;|\\||\\n/);\n  for (const seg of segments) {\n    if (!word.test(seg)) continue;\n    if (/(^|\\s)tmux\\s+-V\\s*$/.test(seg)) continue; // version check: no server involved\n    if (!/\\btmux\\s(.*\\s)?-L\\s*agentmob[\\w-]*(\\s|$)/.test(seg)) return TMUX_RULE;\n  }\n  return null;\n}\n\nexport function findViolations(text) {\n  return SECURITY_RULES.filter((r) => r.re.test(text)).map((r) => r.why);\n}\n", "hooks/session-start.mjs": "// SessionStart: print where the project stands so every session starts oriented.\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nconst root = process.env.CLAUDE_PROJECT_DIR || process.cwd();\nconst read = (p) => (existsSync(join(root, p)) ? readFileSync(join(root, p), \"utf8\") : \"\");\n\nconst roadmap = read(\"docs/ROADMAP.md\");\nconst iters = [...roadmap.matchAll(/^## (Iteration \\d+[^\\n]*?)\\s*·\\s*status:\\s*([^\\n]+)$/gm)]\n  .map((m) => ({ title: m[1].trim(), status: m[2].trim() }));\nconst next = iters.find((i) => i.status !== \"done\");\n\nconst log = read(\".artifacts/harness-log.jsonl\").trim().split(\"\\n\").filter(Boolean);\n\nconst lines = [\"[AgentMob harness]\"];\nlines.push(next ? `Current iteration: ${next.title} (${next.status}). Run /iterate to work on it.`\n                : \"All roadmap iterations are done. Ask the user what's next.\");\nlines.push(`Done: ${iters.filter((i) => i.status === \"done\").length}/${iters.length} iterations.`);\nif (log.length) lines.push(`Friction events logged since last retro: ${log.length} (.artifacts/harness-log.jsonl).`);\nlines.push(\"Spec: docs/SPEC.md · Harness changelog: docs/HARNESS.md\");\nprocess.stdout.write(lines.join(\"\\n\") + \"\\n\");\n", "hooks/stop-gate.mjs": "// Stop hook: if src/ has uncommitted changes, typecheck + unit tests must pass\n// before Claude ends its turn. Exit 2 = keep working, stderr says why.\nimport { execSync } from \"node:child_process\";\nimport { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { logFriction } from \"./friction-log.mjs\";\n\nconst root = process.env.CLAUDE_PROJECT_DIR || process.cwd();\nlet d = \"\"; for await (const c of process.stdin) d += c;\nconst input = JSON.parse(d || \"{}\");\n\nif (input.stop_hook_active) process.exit(0);              // avoid loops\nif (!existsSync(join(root, \"package.json\"))) process.exit(0); // before iteration 0\nif (!existsSync(join(root, \".git\"))) process.exit(0);\n\nlet changed = \"\";\ntry { changed = execSync(\"git status --porcelain -- src\", { cwd: root }).toString().trim(); } catch { process.exit(0); }\nif (!changed) process.exit(0);\n\nconst run = (cmd) => execSync(cmd, { cwd: root, stdio: \"pipe\", timeout: 150_000 });\nfor (const [name, cmd] of [[\"typecheck\", \"npm run -s typecheck\"], [\"unit tests\", \"npm test --silent\"]]) {\n  try { run(cmd); } catch (err) {\n    const out = `${err.stdout ?? \"\"}${err.stderr ?? \"\"}`.trim().split(\"\\n\").slice(-30).join(\"\\n\");\n    logFriction({ kind: \"stop-gate-fail\", step: name, excerpt: out.slice(0, 800) });\n    process.stderr.write(`src/ changed and ${name} failed. Fix before stopping (or tell the user why you can't):\\n${out}\\n`);\n    process.exit(2);\n  }\n}\nprocess.exit(0);\n", "hooks/typecheck-on-edit.mjs": "// PostToolUse (Edit|Write|MultiEdit): typecheck after editing TS files.\n// Exit 2 = errors are shown to Claude as a warning (the edit already happened).\n// When the errors are identical to the last report (e.g. several files written in\n// one batch mid-refactor), print a one-line pointer instead of repeating them\n// (iter-02 retro: the same list was printed 6× in a row).\nimport { execSync } from \"node:child_process\";\nimport { createHash } from \"node:crypto\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { logFriction } from \"./friction-log.mjs\";\n\nconst root = process.env.CLAUDE_PROJECT_DIR || process.cwd();\nconst memo = join(root, \".artifacts\", \"typecheck-last.json\");\nconst REPEAT_WINDOW_MS = 120_000;\n\nlet d = \"\"; for await (const c of process.stdin) d += c;\nconst input = JSON.parse(d || \"{}\");\nconst file = String(input.tool_input?.file_path ?? \"\");\n\nif (!/\\.(tsx?|mts)$/.test(file)) process.exit(0);\nconst pkgPath = join(root, \"package.json\");\nif (!existsSync(pkgPath)) process.exit(0);\nif (!JSON.parse(readFileSync(pkgPath, \"utf8\")).scripts?.typecheck) process.exit(0);\n\nfunction readMemo() {\n  try { return JSON.parse(readFileSync(memo, \"utf8\")); } catch { return null; }\n}\nfunction writeMemo(value) {\n  try { mkdirSync(join(root, \".artifacts\"), { recursive: true }); writeFileSync(memo, JSON.stringify(value)); } catch { /* best effort */ }\n}\n\ntry {\n  execSync(\"npm run -s typecheck\", { cwd: root, stdio: \"pipe\", timeout: 80_000 });\n  writeMemo(null);\n  process.exit(0);\n} catch (err) {\n  const out = `${err.stdout ?? \"\"}${err.stderr ?? \"\"}`.trim().split(\"\\n\").slice(-40).join(\"\\n\");\n  const hash = createHash(\"sha1\").update(out).digest(\"hex\");\n  const last = readMemo();\n  const count = (out.match(/error TS\\d+/g) ?? []).length;\n  if (last && last.hash === hash && Date.now() - last.at < REPEAT_WINDOW_MS) {\n    process.stderr.write(`Typecheck still fails after editing ${file}: the same ${count} error(s) as reported after ${last.file}.\\n`);\n    process.exit(2);\n  }\n  writeMemo({ hash, at: Date.now(), file });\n  logFriction({ kind: \"typecheck-fail\", file, excerpt: out.slice(0, 800) });\n  process.stderr.write(`Typecheck failed after editing ${file}:\\n${out}\\n`);\n  process.exit(2);\n}\n", "selftest/cases.yaml": "# Ported from AgentMob's scripts/check-hooks.mjs (hook self-test), plus its three deny rules.\ncases:\n- name: session start prints status\n  event: SessionStart\n  input: {}\n  expect: allow\n- name: safe TS edit\n  event: PreToolUse\n  tool: Write\n  input:\n    file_path: src/x.ts\n    content: const a = 1;\n  expect: allow\n- name: unsafe TS edit (nodeIntegration on)\n  event: PreToolUse\n  tool: Write\n  input:\n    file_path: src/x.ts\n    content: 'new BrowserWindow({ webPreferences: { nodeIntegration: true } })'\n  expect: block\n- name: raw non-breaking space in a TS file\n  event: PreToolUse\n  tool: Write\n  input:\n    file_path: src/x.ts\n    content: const s = \"a b\";\n  expect: block\n- name: unsafe text in a .md file is ignored\n  event: PreToolUse\n  tool: Write\n  input:\n    file_path: notes.md\n    content: 'nodeIntegration: true'\n  expect: allow\n- name: edit that turns contextIsolation off\n  event: PreToolUse\n  tool: Edit\n  input:\n    file_path: src/main/window.ts\n    old_string: 'contextIsolation: true'\n    new_string: 'contextIsolation: false'\n  expect: block\n- name: plain bash\n  event: PreToolUse\n  tool: Bash\n  input:\n    command: ls -la\n  expect: allow\n- name: tmux on the default socket\n  event: PreToolUse\n  tool: Bash\n  input:\n    command: tmux ls\n  expect: block\n- name: bare tmux\n  event: PreToolUse\n  tool: Bash\n  input:\n    command: tmux\n  expect: block\n- name: tmux after &&\n  event: PreToolUse\n  tool: Bash\n  input:\n    command: ls && tmux attach\n  expect: block\n- name: tmux on the agentmob-test socket\n  event: PreToolUse\n  tool: Bash\n  input:\n    command: tmux -L agentmob-test ls\n  expect: allow\n- name: tmux -V\n  event: PreToolUse\n  tool: Bash\n  input:\n    command: tmux -V\n  expect: allow\n- name: tmux mentioned in a heredoc body\n  event: PreToolUse\n  tool: Bash\n  input:\n    command: 'cat > f.ts <<''EOF''\n\n      // uses the test tmux socket\n\n      EOF\n\n      echo done'\n  expect: allow\n- name: tmux mentioned in a quoted string\n  event: PreToolUse\n  tool: Bash\n  input:\n    command: echo \"run tmux ls later\"\n  expect: allow\n- name: tmux inside bash -c\n  event: PreToolUse\n  tool: Bash\n  input:\n    command: bash -c \"tmux kill-server\"\n  expect: block\n- name: agentmob socket inside bash -c\n  event: PreToolUse\n  tool: Bash\n  input:\n    command: bash -c \"tmux -L agentmob-test ls\"\n  expect: allow\n- name: the /verify cleanup command\n  event: PreToolUse\n  tool: Bash\n  input:\n    command: tmux -L agentmob-test kill-server 2>/dev/null || true\n  expect: allow\n- name: heredoc body that talks about sh -c and tmux\n  event: PreToolUse\n  tool: Bash\n  input:\n    command: 'python3 - <<''EOF''\n\n      s = \"guard: bash -c / bash << / tmux ls\"\n\n      EOF'\n  expect: allow\n- name: tmux after a heredoc that was data\n  event: PreToolUse\n  tool: Bash\n  input:\n    command: 'cat > f <<''EOF''\n\n      hello\n\n      EOF\n\n      tmux ls'\n  expect: block\n- name: tmux in a heredoc piped to a shell\n  event: PreToolUse\n  tool: Bash\n  input:\n    command: 'cat <<EOF | sh\n\n      tmux ls\n\n      EOF'\n  expect: block\n- name: tmux in a heredoc fed to a shell\n  event: PreToolUse\n  tool: Bash\n  input:\n    command: 'bash <<EOF\n\n      tmux ls\n\n      EOF'\n  expect: block\n- name: 'deny rule: tmux kill-server'\n  event: PreToolUse\n  tool: Bash\n  input:\n    command: tmux kill-server\n  expect: block\n- name: 'deny rule: git push'\n  event: PreToolUse\n  tool: Bash\n  input:\n    command: git push origin main\n  expect: block\n- name: reading an ssh key is denied\n  event: PreToolUse\n  tool: Read\n  input:\n    file_path: ~/.ssh/id_ed25519\n  expect: block\n- name: stop gate lets a looping stop through\n  event: Stop\n  input:\n    stop_hook_active: true\n  expect: allow\n", "skills/harness-retro/SKILL.md": "---\nname: harness-retro\ndescription: End-of-iteration retrospective that evolves the AgentMob Claude Code harness (CLAUDE.md, hooks, skills, agents) from what actually went wrong.\n---\n\nEvolve the harness from evidence, not from ideas. Inputs:\n- `.artifacts/harness-log.jsonl` — guard blocks, tool failures, typecheck and\n  stop-gate failures logged by the hooks during this iteration.\n- The \"Friction\" section of the current `docs/iterations/NN-*.md`.\n- Corrections the user made in this conversation (\"no, not like that\", repeated\n  instructions, things they had to tell you twice).\n\n## Steps\n1. Summarise the evidence into at most 5 friction points, each with a count or\n   example. Ignore one-off noise.\n2. For each, pick the **smallest durable fix**, in this order of preference:\n   - **Hook** — a rule that must always hold, or a check that should run\n     automatically. Deterministic beats remembered.\n   - **Skill** — a multi-step procedure that was done by hand more than once.\n   - **Agent** — a review that benefits from a fresh context (security, UX vs spec).\n   - **CLAUDE.md line** — missing context. One line, in the right section.\n   - **Remove** — a hook that fired falsely, a rule nobody needed, a skill never\n     used. Pruning is evolution too.\n3. Show the proposed changes to the user as a short list and wait for their OK.\n4. Apply them. For hooks: add cases to `scripts/check-hooks.mjs` — at least one that\n   should pass and one that should block — and run it until green.\n5. Add an entry to `docs/HARNESS.md` › Changelog:\n   `vN — iter-NN — <change> — because <evidence>`. Update the inventory table.\n6. Archive the log: move `.artifacts/harness-log.jsonl` to\n   `.artifacts/harness-log-iter-NN.jsonl` so the next iteration starts clean.\n7. Keep CLAUDE.md under ~150 lines. If it's growing, move detail into `docs/`.\n", "skills/iterate/SKILL.md": "---\nname: iterate\ndescription: Run the next AgentMob roadmap iteration end to end — plan, build, verify, retro, commit.\nargument-hint: \"[iteration number, optional]\"\ndisable-model-invocation: true\n---\n\nRun one iteration of AgentMob. Target: iteration $ARGUMENTS if given, otherwise the\nfirst iteration in `docs/ROADMAP.md` whose status isn't `done`.\n\n## 1. Plan (stop for the user's OK)\n1. Read `docs/SPEC.md`, the iteration's section in `docs/ROADMAP.md`, and the latest\n   file in `docs/iterations/` (last retro).\n2. Copy `docs/iterations/TEMPLATE.md` to `docs/iterations/NN-<slug>.md` and fill the\n   Plan section: files to create/change, pure modules + their unit tests, e2e checks\n   that prove the \"Done when\" criteria, risks.\n3. Anything the spec doesn't decide → list it as a question. Show the plan and the\n   questions to the user and **wait for their answer** before writing code.\n4. Set the iteration status to `in progress` in `docs/ROADMAP.md`.\n\n## 2. Build\n- Pure logic first, in `src/main/core/`, with Vitest tests written alongside.\n- Then the Electron / pty / UI glue, kept thin. Add `data-testid`s to anything the\n  e2e test needs.\n- Small steps. The PostToolUse hook typechecks after every TS edit — fix errors as\n  they appear, don't batch them.\n- Hit something the harness blocks or that feels like a missing tool? Note it in the\n  iteration file under \"Friction\" right away; the retro uses it.\n\n## 3. Verify\n- Run `/verify`. Fix and re-run until green, and Read the screenshots it produces.\n- If the iteration touched web views, IPC, preload or `openExternal`, run the\n  `electron-security-reviewer` agent and address its findings.\n- Run the `e2e-verifier` agent with the iteration's \"Done when\" list. It checks\n  independently; treat anything it marks unmet as not done.\n\n## 4. Close\n1. Run `/harness-retro`.\n2. Fill the iteration file's Result section (what shipped, what was deferred).\n3. Set status to `done` in `docs/ROADMAP.md` (add deferred items to \"Later\").\n4. `git add -A && git commit -m \"iter-NN: <summary>\"`.\n5. Tell the user in 3–5 lines: what works now, how to try it (`npm run dev` + what to\n   click), what changed in the harness.\n", "skills/verify/SKILL.md": "---\nname: verify\ndescription: Run AgentMob's full verification — typecheck, lint, security scan, hook self-test, unit tests, dev launch, Electron e2e — and look at the screenshots. Use before calling any UI or main-process change done.\nallowed-tools: Bash(npm run *) Bash(npm test*) Bash(node scripts/*) Read\n---\n\n1. `node scripts/verify.mjs` — runs, in order, and stops at the first failure:\n   typecheck · lint · `check-security.mjs` (Electron security rules over `src/`) ·\n   `check-hooks.mjs` (hook self-test: add a case when a hook changes) · Vitest ·\n   `check-dev.mjs` (`npm run dev` comes up) · build · `test:e2e` (node-pty check +\n   Playwright `_electron`). It always kills the `agentmob-test` tmux server at the end.\n   On failure, fix and resume with `node scripts/verify.mjs --from <step>`.\n   Don't hand-chain the steps with `set -e` — it didn't stop on failure in the agent\n   shell (iter-01).\n2. e2e rules: tests use a temp repo, temp userData and `tmux -L agentmob-test`,\n   never real agent CLIs (use `scripts/fake-agent.sh` once it exists) and never the\n   user's repos.\n3. **Look at the result.** List `.artifacts/screens/` and Read every screenshot from\n   this run. Compare against `docs/SPEC.md` §3 layout and the iteration's \"Done when\".\n   Describe what you see in one or two lines per screenshot. A blank, cropped or\n   overlapping UI is a failure even if tests pass.\n\nReport as a short table: step · result · note (verify.mjs prints it).\n"}}
