history+outline+guides: CI/CD pipeline done, agent memory guide, CI improvements noted

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Rokojori 2026-07-13 21:56:25 +02:00
parent f08126bd43
commit 54267624bf
6 changed files with 144 additions and 22 deletions

View File

@ -17,6 +17,7 @@ var NAV_DATA = {
{ title: 'Writing Editor Panels', path: 'guides/writing-editor-panels/index.html' }, { title: 'Writing Editor Panels', path: 'guides/writing-editor-panels/index.html' },
{ title: 'Writing Backend Routes', path: 'guides/writing-backend-routes/index.html' }, { title: 'Writing Backend Routes', path: 'guides/writing-backend-routes/index.html' },
{ title: 'Locales', path: 'guides/locales/index.html' }, { title: 'Locales', path: 'guides/locales/index.html' },
{ title: 'Agent Memory', path: 'guides/agent-memory/index.html' },
] ]
}, },
{ {

View File

@ -0,0 +1,70 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Agent Memory — Roject</title>
<link rel="stylesheet" href="../../_assets_/styles.css">
<link rel="stylesheet" href="../../_assets_/nav.css">
</head>
<body>
<div class="page">
<header>
<h1>Agent Memory</h1>
<p class="subtitle">How Claude agents should store and recall information about this project.</p>
</header>
<section>
<h2>The rule</h2>
<div class="card">
<h3>The workspace is the memory</h3>
<p>
All persistent knowledge about this project — planned features, decisions made,
open improvements, session notes — lives in <code>workspace/</code> and is
version-controlled. Agents must write project knowledge here, not into local
Claude memory files (<code>~/.claude/memory/</code>). The workspace is visible
to the user, survives across machines, and is the single source of truth.
</p>
</div>
<div class="card">
<h3>What goes where</h3>
<ul style="line-height:1.9">
<li><strong>Planned features and open items</strong><code>workspace/outline/index.html</code>, Smaller open improvements list or a numbered priority card.</li>
<li><strong>Session notes and what was built</strong><code>workspace/history/YYYY/MM-Month/DD-Day/index.html</code> via the Update History action.</li>
<li><strong>Coding conventions and how-tos</strong> → a new page under <code>workspace/guides/</code>.</li>
<li><strong>Recurring procedures</strong> → a new page under <code>workspace/actions/</code>.</li>
</ul>
</div>
<div class="card">
<h3>What may go in Claude local memory</h3>
<p>
Only things that genuinely cannot live in the repo:
</p>
<ul style="line-height:1.9">
<li>The path to the project directory on the local machine.</li>
<li>Paths to sibling projects (e.g. <code>rokojori-auth</code>).</li>
<li>User preferences that predate or are unrelated to this project.</li>
</ul>
<p style="margin-top:0.75rem">
Never write planned features, open bugs, session summaries, or architectural
decisions into Claude local memory. If it belongs to the project, it belongs
in the workspace.
</p>
</div>
</section>
<footer>
Roject &mdash; guides
</footer>
</div>
<script>var NAV_ROOT = '../../';</script>
<script src="../../_assets_/nav-data.js"></script>
<script src="../../_assets_/nav.js"></script>
</body>
</html>

View File

@ -65,6 +65,18 @@
</p> </p>
</div> </div>
<div class="card">
<h3>Agent Memory</h3>
<p>
Where agents should store and recall project knowledge — the rule that the
workspace is the memory, what goes in the outline vs. history vs. guides,
and what (little) may go in Claude local memory files.
</p>
<p style="margin-top:0.75rem">
<a href="agent-memory/index.html">Read the guide</a>
</p>
</div>
</section> </section>
<footer> <footer>

View File

@ -213,6 +213,39 @@
</div> </div>
</section> </section>
<section>
<h2>What we built — CI/CD pipeline</h2>
<div class="card">
<h3>Webhook-based auto-deploy</h3>
<p>
Replaced the manual <code>git pull &amp;&amp; npm run build &amp;&amp; systemctl restart roject</code>
deploy with a Gitea webhook calling <code>POST /api/deploy</code> on the Roject server itself.
The endpoint verifies the <code>X-Gitea-Signature</code> HMAC-SHA256 signature against
<code>DEPLOY_WEBHOOK_SECRET</code>, checks the push is to <code>refs/heads/main</code>,
responds 200 immediately, then spawns a detached bash process that pulls, builds, and
restarts the service — surviving the <code>systemctl restart</code> that kills the parent.
</p>
<div class="tags">
<span class="tag">Gitea webhook</span>
<span class="tag">HMAC-SHA256</span>
<span class="tag">detached spawn</span>
<span class="tag">/api/deploy</span>
</div>
</div>
<div class="card">
<h3>Why not Gitea Actions runner</h3>
<p>
Spent significant time attempting a <code>gitea-runner</code> (act_runner) setup.
The runner requires Docker to execute job steps; without it the <code>:host</code>
execution mode produced a path-resolution bug. Installing Docker would have made
<code>systemctl restart</code> from inside a container awkward. A direct webhook
to the server is simpler, fully transparent, and fits a single-server deploy perfectly.
</p>
</div>
</section>
<section> <section>
<h2>What's next</h2> <h2>What's next</h2>
@ -223,6 +256,10 @@
Also: graceful 401 handling in data-fetching components (groups, projects, etc.) Also: graceful 401 handling in data-fetching components (groups, projects, etc.)
so they display a sensible message instead of throwing a JS error. so they display a sensible message instead of throwing a JS error.
</p> </p>
<p style="margin-top:0.75rem">
CI improvements planned: send an email notification after each auto-deploy restart;
switch webhook trigger to a <code>dev</code> branch to avoid deploying on every commit to main.
</p>
</div> </div>
</section> </section>

View File

@ -21,7 +21,7 @@
<div class="card"> <div class="card">
<h3><a href="2026/07-July/13-Sunday/index.html">Sunday, 13 July 2026</a></h3> <h3><a href="2026/07-July/13-Sunday/index.html">Sunday, 13 July 2026</a></h3>
<p>rokojori-auth built and deployed; Roject local auth replaced with JWT middleware — cookie-based login via account.rokojori.com, systemd EnvironmentFile fix.</p> <p>rokojori-auth built and deployed; Roject local auth replaced with JWT middleware; CI/CD pipeline — webhook-based auto-deploy on push to main via /api/deploy.</p>
</div> </div>
<div class="card"> <div class="card">

View File

@ -91,24 +91,7 @@
</div> </div>
<div class="card"> <div class="card">
<h3>1 — CI pipeline (server is live)</h3> <h3>1 — Electron desktop app + local filesystem access</h3>
<p>
The server is deployed and running at <code>https://roject.rokojori.com</code>
(nginx + systemd + Let's Encrypt on Server A). What remains is automating the
deploy on push: a Gitea Actions runner installed on Server A registers with the
repo on <code>community.rokojori.com</code> and runs a workflow that pulls,
builds, and restarts the service on every push to main. This is the last piece
that turns the manual deploy into a proper CI/CD pipeline.
</p>
<div class="tags">
<span class="tag">Gitea Actions runner</span>
<span class="tag">act_runner</span>
<span class="tag">auto-deploy on push</span>
</div>
</div>
<div class="card">
<h3>2 — Electron desktop app + local filesystem access</h3>
<p> <p>
Package Roject as a standalone desktop application using Electron. Since the Package Roject as a standalone desktop application using Electron. Since the
frontend is already plain HTML/JS/CSS, the Electron integration is mostly frontend is already plain HTML/JS/CSS, the Electron integration is mostly
@ -139,7 +122,7 @@
</div> </div>
<div class="card"> <div class="card">
<h3>3 — Local git repository integration</h3> <h3>2 — Local git repository integration</h3>
<p> <p>
Git integration inside the editor: file status indicators in the tree, staging, Git integration inside the editor: file status indicators in the tree, staging,
commit, push and pull, and eventually diffs and history. This depends on local commit, push and pull, and eventually diffs and history. This depends on local
@ -163,7 +146,7 @@
</div> </div>
<div class="card"> <div class="card">
<h3>4 — Internet tunnel / port pass-through relay</h3> <h3>3 — Internet tunnel / port pass-through relay</h3>
<p> <p>
A tunneling feature that allows local devices — a main workstation running A tunneling feature that allows local devices — a main workstation running
Stable Diffusion, a local LLM, a GDScript language server, or any other Stable Diffusion, a local LLM, a GDScript language server, or any other
@ -201,7 +184,7 @@
</div> </div>
<div class="card"> <div class="card">
<h3>5 — Mobile app (PWA first, native shell later)</h3> <h3>4 — Mobile app (PWA first, native shell later)</h3>
<p> <p>
Make Roject usable on a phone or tablet. The quickest path given the existing Make Roject usable on a phone or tablet. The quickest path given the existing
web frontend is a Progressive Web App (PWA) — a manifest file and a service web frontend is a Progressive Web App (PWA) — a manifest file and a service
@ -230,6 +213,23 @@
</div> </div>
</div> </div>
<div class="card">
<h3>Done — CI/CD pipeline</h3>
<p>
Auto-deploy on push to main via a Gitea webhook calling
<code>POST /api/deploy</code> on the Roject server. The endpoint verifies the
<code>X-Gitea-Signature</code> HMAC-SHA256 signature, checks the branch is
<code>main</code>, responds immediately, then spawns a detached bash process
that runs <code>git pull &amp;&amp; npm run build &amp;&amp; systemctl restart roject</code>.
The detached process survives the <code>systemctl restart</code> that kills the parent.
</p>
<div class="tags">
<span class="tag">Gitea webhook</span>
<span class="tag">HMAC-SHA256</span>
<span class="tag">detached spawn</span>
</div>
</div>
<div class="card"> <div class="card">
<h3>Done — Centralized auth: rokojori-auth</h3> <h3>Done — Centralized auth: rokojori-auth</h3>
<p> <p>
@ -283,6 +283,8 @@
<li>The group editor and account delete button still use the browser <code>confirm()</code> instead of the custom <code>&lt;confirm-dialog&gt;</code>.</li> <li>The group editor and account delete button still use the browser <code>confirm()</code> instead of the custom <code>&lt;confirm-dialog&gt;</code>.</li>
<li>Non-text files (images, PDFs) are visible in the tree but not openable — a <code>MediaViewerPanel</code> is planned.</li> <li>Non-text files (images, PDFs) are visible in the tree but not openable — a <code>MediaViewerPanel</code> is planned.</li>
<li>No real-time multi-user collaboration yet.</li> <li>No real-time multi-user collaboration yet.</li>
<li>CI deploy endpoint (<code>/api/deploy</code>) should send an email notification after each restart so deploys are visible without checking logs.</li>
<li>The Gitea webhook currently triggers on pushes to <code>main</code> — switch to a <code>dev</code> branch so every commit doesn't redeploy.</li>
</ul> </ul>
</div> </div>