--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8">
+ <title>Updating a project from the skeleton</title>
+ <script>
+ {
+ let dirpr_library = null;
+ try{ dirpr_library = localStorage.getItem("RT.dirpr_library"); }catch(e){}
+ window.RT = window.RT || {};
+ RT.dirpr_library = RT.dirpr_library || dirpr_library || "https://style.ReasoningTechnology.com/Manuscript";
+ document.write('<script src="' + RT.dirpr_library + '/Core/RT-Manuscript_make.js"><\/script>');
+ }
+ </script>
+ <script>
+ window.RT.theme_preference('inverse_wheat');
+ window.RT.load('Layout/paginate');
+ window.RT.load('Layout/article_tech_ref');
+ window.RT.load('Element/theme_selector');
+ </script>
+ </head>
+ <body>
+ <RT·theme-selector></RT·theme-selector>
+ <RT·article>
+ <RT·title
+ author="RT"
+ date="2026-12-02"
+ title="Updating a project from the skeleton">
+ </RT·title>
+
+ <RT·TOC level="1"></RT·TOC>
+
+ <h1>Purpose</h1>
+ <p>
+ <RT·code>new-project</RT·code> makes a project from a copy of the Harmony skeleton. From then on the project has its own copy, so a fix made to the skeleton in Harmony reaches a project only when it is carried there. This document gives how the administrator sees how far a project has drifted from the skeleton, and brings it up to date, with two tools in <RT·code>administrator/tool</RT·code>:
+ </p>
+ <ol>
+ <li><RT·code>skeleton_diff</RT·code> : compares a project with Harmony, and changes nothing.</li>
+ <li><RT·code>skeleton_update</RT·code> : brings a project onto the current skeleton.</li>
+ </ol>
+ <p>
+ Both are given the two checkouts by path, so they are run from the administrator role of either, for example with Harmony and the project side by side in <RT·code>~/project</RT·code>.
+ </p>
+
+ <h1>What the skeleton is</h1>
+ <p>
+ The skeleton is the set of files in Harmony's last commit, as <RT·code>new-project</RT·code> takes it, less what a project has of its own: <RT·code>README.md</RT·code>, <RT·code>LICENSE</RT·code>, the Opus file <RT·code>0pus_Harmony</RT·code>, and the example <RT·code>developer/authored/ExampleGreet.make/</RT·code>. A fix to the skeleton is therefore made in Harmony and committed there first: a change not committed in Harmony is not part of the skeleton.
+ </p>
+ <p>
+ A file in one of these trees that is not a skeleton file belongs to the project, and stays where it is: <RT·code>administrator/authored/</RT·code>, <RT·code>administrator/document/</RT·code>, <RT·code>developer/authored/</RT·code>, <RT·code>developer/document/</RT·code>, <RT·code>developer/experiment/</RT·code>, <RT·code>document/</RT·code>, <RT·code>shared/authored/</RT·code>, <RT·code>tester/authored/</RT·code> and <RT·code>tester/document/</RT·code>. Harmony's own documents in these trees, such as <RT·code>document/introduction_Harmony.html</RT·code>, are skeleton files: an update replaces the project's copies with Harmony's, so a project's documents about Harmony stay current with it.
+ </p>
+
+ <h1>Seeing the drift</h1>
+ <RT·code>
+ > skeleton_diff ~/project/Harmony ~/project/Jizo
+ </RT·code>
+ <p>
+ It compares the files git sees in each checkout, those tracked and those untracked that no <RT·code>.gitignore</RT·code> excludes, leaving out <RT·code>scratchpad</RT·code>, <RT·code>consumer</RT·code> and <RT·code>authored</RT·code> directories, which are never skeleton. Given <RT·code>all_files</RT·code> first, it compares every file on disk instead. It reports in five sections:
+ </p>
+ <ol>
+ <li>The Opus file: present, and named <RT·code>0pus_<project></RT·code>.</li>
+ <li>Skeleton files the project is missing.</li>
+ <li>Skeleton files whose content differs, grouped by which copy was modified last: Harmony's, the project's, or neither. Harmony newer usually means a fix not yet carried over; project newer, a change made in the project that perhaps belongs in Harmony.</li>
+ <li>Files that differ in their permissions alone.</li>
+ <li>The project's own files, outside the skeleton, for information.</li>
+ </ol>
+ <p>
+ The count of issues at the end covers the first four sections. A project newer than Harmony is worth reading before updating: a fix made in the project is lost when the update replaces the file, unless it is first made in Harmony, or the project keeps its own version, as below.
+ </p>
+
+ <h1>Updating</h1>
+ <ol>
+ <li>Commit the project. <RT·code>skeleton_update run</RT·code> refuses a work tree with uncommitted changes, so that what it does is one change git can show and undo.</li>
+ <li>Read what it would do:
+ <RT·code>
+ > skeleton_update preview run ~/project/Harmony ~/project/Jizo
+ </RT·code>
+ </li>
+ <li>Run it, without <RT·code>preview</RT·code>.</li>
+ <li><RT·code>git add -A</RT·code>, read <RT·code>git status</RT·code> and the diff, then commit. git takes each moved file as a rename, by its content, so <RT·code>git log --follow</RT·code> follows its history.</li>
+ <li>Run <RT·code>skeleton_update preview run</RT·code> again: it reports nothing left to do.</li>
+ </ol>
+ <p>
+ Skeleton files are copied in from Harmony, replacing the project's copies, and an Opus file, <RT·code>0pus_<project></RT·code>, is made when the project has none. Two are merged instead, the project's own lines kept beside Harmony's: <RT·code>.gitignore</RT·code> and <RT·code>shared/tool/version</RT·code>. Compiled Python caches are deleted, and directories left empty are removed. Files the project's <RT·code>.gitignore</RT·code> ignores, such as a local Python build, are left where they are, and listed at the end of the log.
+ </p>
+
+ <h2>A project that differs from the skeleton</h2>
+ <p>
+ A project laid out after Harmony needs nothing more. One that is not, such as an older project brought onto Harmony, or one that keeps its own version of a skeleton file, is given a <RT·term>plan</RT·term>: a Python file, named as the last argument, holding these names:
+ </p>
+ <ol>
+ <li><RT·code>MOVE</RT·code> : <RT·code>{old path: new path}</RT·code>; a path ending in <RT·code>/</RT·code> moves a directory tree.</li>
+ <li><RT·code>KEEP</RT·code> : paths kept as they are, including skeleton files the project has its own version of.</li>
+ <li><RT·code>DEPRECATE</RT·code> : paths deprecated even though Harmony has a place for them.</li>
+ <li><RT·code>DUPLICATE</RT·code> : trees whose files are copies of files kept elsewhere.</li>
+ <li><RT·code>EXECUTABLE</RT·code> : paths, after any move, given execute permission where they have read permission.</li>
+ </ol>
+ <p>
+ A file in no place Harmony has, and not moved by the plan, is <RT·term>deprecated</RT·term>: moved, its path kept, under <RT·code>developer/authored/deprecated/</RT·code>. Nothing is lost, and each file's old place can be read from its new path. A file under a <RT·code>DUPLICATE</RT·code> tree is deleted when the project holds a file of the same content elsewhere, and deprecated otherwise.
+ </p>
+
+ <h1>Not yet settled</h1>
+ <p>
+ Each project holds a copy of the skeleton, so each fix is made once in Harmony and then carried into every project. Making Harmony the one authoritative copy, while still letting a project customize a skeleton file, would end the carrying; how to do that is an open question.
+ </p>
+
+ </RT·article>
+ </body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8">
+ <title>Writing an installer</title>
+ <script>
+ {
+ let dirpr_library = null;
+ try{ dirpr_library = localStorage.getItem("RT.dirpr_library"); }catch(e){}
+ window.RT = window.RT || {};
+ RT.dirpr_library = RT.dirpr_library || dirpr_library || "https://style.ReasoningTechnology.com/Manuscript";
+ document.write('<script src="' + RT.dirpr_library + '/Core/RT-Manuscript_make.js"><\/script>');
+ }
+ </script>
+ <script>
+ window.RT.theme_preference('inverse_wheat');
+ window.RT.load('Layout/paginate');
+ window.RT.load('Layout/article_tech_ref');
+ window.RT.load('Element/theme_selector');
+ </script>
+ </head>
+ <body>
+ <RT·theme-selector></RT·theme-selector>
+ <RT·article>
+ <RT·title
+ author="RT"
+ date="2026-12-02"
+ title="Writing an installer">
+ </RT·title>
+
+ <RT·TOC level="1"></RT·TOC>
+
+ <h1>Purpose</h1>
+ <p>
+ A project whose work product runs outside the checkout, for other accounts, or under root, is installed: copied into a place in the system, such as <RT·code>/usr/local/lib/<project></RT·code>, owned by root. This document gives how an RT installer is written, and why. Jizo's <RT·code>install</RT·code> is a worked example of each point. An installer is a tool script, so <RT·code>writing_tool-script.html</RT·code> applies to it too.
+ </p>
+
+ <h1>Root runs only what root installed</h1>
+ <p>
+ Root does not run code another account can change. Were root to run a program from a checkout, the account owning the checkout could change the program and wait: the next time root ran it, that account would have root. So root runs the installed copy, which only root can change, and an account using the program runs a version that stays as it was installed, however the checkout changes.
+ </p>
+ <p>
+ The trust is given once, at each install, by the person acting as root, who reads what would change before the installer changes it. The first install runs the installer from the checkout; after that, root runs the installed installer, given the checkout's directory to install from, so root runs only what it installed before.
+ </p>
+
+ <h1>It installs from consumer</h1>
+ <p>
+ The installer installs from the checkout's <RT·code>consumer</RT·code> directory, wherever it is run from, so what is installed is what the tester tested. <RT·code>build</RT·code> and <RT·code>promote</RT·code> fill <RT·code>consumer</RT·code> from <RT·code>developer/authored</RT·code>, so the installer compares the two, and warns, naming the files, when they differ: a change not yet built is not installed, and without the warning the installer would say that nothing would change.
+ </p>
+
+ <h1>It reads the checkout as data</h1>
+ <p>
+ Running under root, the installer reads files another account owns. It reads them as data, never runs them, and does not follow a symbolic link: the account could point a link at a file only root can read, such as <RT·code>/etc/shadow</RT·code>, and have root copy it where the account can read it. It walks the tree through directory descriptors, as Python's <RT·code>os.fwalk</RT·code> with <RT·code>follow_symlinks=False</RT·code>, opens each file with <RT·code>O_NOFOLLOW</RT·code>, and refuses a link it finds.
+ </p>
+
+ <h1>It checks where it installs</h1>
+ <ol>
+ <li>Every directory from the installation up to <RT·code>/</RT·code> is owned by root, and writable by no other account; otherwise another account could replace what was installed, and the installer refuses.</li>
+ <li>The installation holds only what the installer put there. Finding a file it does not know, it refuses, naming the file, and removes nothing; files of an earlier layout of its own, which it knows by name, it removes.</li>
+ <li>What the installed program needs from the system, such as a command it runs, is there.</li>
+ </ol>
+
+ <h1>A command root runs is isolated</h1>
+ <p>
+ A root shell reached with <RT·code>su</RT·code> keeps the account's <RT·code>PATH</RT·code> and <RT·code>PYTHONPATH</RT·code>, so a Python command root runs could take another account's <RT·code>python3</RT·code>, or import another account's module. The installer replaces the first line of each command root runs with <RT·code>#!/usr/bin/python3 -IB</RT·code>: the interpreter is named by its full path, isolated mode, <RT·code>-I</RT·code>, ignores <RT·code>PYTHONPATH</RT·code> and the account's own packages, and <RT·code>-B</RT·code> writes no compiled cache. The commands are installed in a directory of their own, named for the privilege they run with, such as <RT·code>privileged</RT·code>, apart from those any account runs, in <RT·code>unprivileged</RT·code>, which keep their first line.
+ </p>
+
+ <h1>It writes only what differs</h1>
+ <p>
+ As <RT·code>promote</RT·code> does, the installer compares what it would install with what is installed, and writes only what differs. It reports each file Added, Updated, when its content, owner or mode differed, or Removed, when the checkout no longer has it. It first says what it compared: the number of files on each side, and anything that must agree between them, such as the version of a data format the program reads.
+ </p>
+ <p>
+ Each file is written through a temporary file in the same directory, made with <RT·code>O_CREAT | O_EXCL | O_NOFOLLOW</RT·code>, given its owner and mode, then renamed over the old one. A rename within a directory is atomic, so a program starting meanwhile finds the old file or the new one, never part of one.
+ </p>
+
+ <h1>Its commands</h1>
+ <RT·code>
+ help | -h | --help print the help, also printed given no arguments
+ preview say what would be added, updated and removed, install nothing
+ diff the same, with the lines that would change in each file
+ run install, under root
+ remove remove what the installer put there, under root
+ from <consumer dirp> the checkout's consumer directory to install from; needed
+ when the installer run is the installed one
+ </RT·code>
+ <p>
+ <RT·code>preview</RT·code> and <RT·code>diff</RT·code> run under any account; <RT·code>run</RT·code> and <RT·code>remove</RT·code> refuse under any account but root. The exit status is 0 when done, 1 when refused, 2 when given wrong arguments.
+ </p>
+
+ <h1>Tests do not install</h1>
+ <p>
+ The tester runs the work product from <RT·code>consumer</RT·code>, under the tester's own account, so nothing is installed for a test. A program that would act as root when installed takes, under the tester's account, test places the tester owns, such as test devices under the tester's data directory.
+ </p>
+
+ </RT·article>
+ </body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8">
+ <title>Handing over work in numbered passes</title>
+ <script>
+ {
+ let dirpr_library = null;
+ try{ dirpr_library = localStorage.getItem("RT.dirpr_library"); }catch(e){}
+ window.RT = window.RT || {};
+ RT.dirpr_library = RT.dirpr_library || dirpr_library || "https://style.ReasoningTechnology.com/Manuscript";
+ document.write('<script src="' + RT.dirpr_library + '/Core/RT-Manuscript_make.js"><\/script>');
+ }
+ </script>
+ <script>
+ window.RT.theme_preference('inverse_wheat');
+ window.RT.load('Layout/paginate');
+ window.RT.load('Layout/article_tech_ref');
+ window.RT.load('Element/theme_selector');
+ </script>
+ </head>
+ <body>
+ <RT·theme-selector></RT·theme-selector>
+ <RT·article>
+ <RT·title
+ author="RT"
+ date="2026-12-02"
+ title="Handing over work in numbered passes">
+ </RT·title>
+
+ <RT·TOC level="1"></RT·TOC>
+
+ <h1>Purpose</h1>
+ <p>
+ Work made outside the project's checkout, by a collaborator, a person or an AI, working in a copy of it, is handed to the project in <RT·term>passes</RT·term>. A pass is one coherent change, numbered in the order it was made, that the administrator can read before anything changes, apply with one command, and take back with git. This document gives what a pass holds, how it is run, and how one is made.
+ </p>
+
+ <h1>What a pass holds</h1>
+ <ol>
+ <li><RT·code>pass_<N>.patch</RT·code> : the change to the project's files, as <RT·code>git diff</RT·code> makes it.</li>
+ <li><RT·code>pass_<N></RT·code> : the <RT·term>pass program</RT·term>. It checks that it is run where it belongs, applies the patch, makes any change a patch cannot, such as one to a database the program keeps, and says what is left to do. What it acts on, such as the database's path, is built in.</li>
+ <li>Documents, each sent whole, never in the patch: a patch to prose is hard to read, while a whole document is read as it will stand, and compared with the old copy before it replaces it. A document changed in the project since the collaborator's copy was taken is said to the collaborator first, so the change is not overwritten.</li>
+ </ol>
+ <p>
+ The number orders the passes: each patch is made against the project as the pass before it left it, and applies on that. A pass sent and not yet run can be replaced by another of the same number; once run, a correction is a new pass.
+ </p>
+
+ <h1>Where the files go</h1>
+ <p>
+ The patch and the pass program are put in <RT·code>$REPO_HOME/scratchpad</RT·code>. git ignores the scratchpad, so they never end up in the repository. Documents go straight to their place in the project, over the old copy.
+ </p>
+
+ <h1>Running a pass</h1>
+ <p>
+ In the administrator's shell, which <RT·code>./setup administrator</RT·code> leaves at the top of the project, <RT·code>$REPO_HOME</RT·code>:
+ </p>
+ <RT·code>
+ > ./scratchpad/pass_<N> preview
+ > ./scratchpad/pass_<N> run
+ </RT·code>
+ <p>
+ <RT·code>preview</RT·code> makes the checks, and says what <RT·code>run</RT·code> would do, changing nothing. <RT·code>run</RT·code> makes the checks, applies the patch, makes the change to the data, if the pass has one, then lists, numbered, the steps left, which belong to other roles and so are not the pass program's to take:
+ </p>
+ <ol>
+ <li>Administrator: read <RT·code>git status</RT·code> and <RT·code>git diff</RT·code>, then commit.</li>
+ <li>Developer: <RT·code>build</RT·code> and <RT·code>promote write</RT·code>.</li>
+ <li>Tester: the tests.</li>
+ <li>Root, in its own terminal: the install, when the project installs.</li>
+ </ol>
+ <p>
+ <RT·code>git apply</RT·code> changes the working tree, not the history: the commit is the administrator's own, made after reading the change. It applies the whole patch or nothing, so a patch that does not fit changes no file.
+ </p>
+
+ <h1>What the pass program checks</h1>
+ <p>
+ Before it changes anything, the pass program checks that the shell, the directory, and the checkout all belong to the project the pass was made for, and refuses, saying which check failed and how to put it right:
+ </p>
+ <ol>
+ <li><RT·code>REPO_HOME</RT·code> is set: a role has been taken on.</li>
+ <li><RT·code>PROJECT</RT·code> is the project the pass was made for, which is built in.</li>
+ <li>The current directory is <RT·code>$REPO_HOME</RT·code>.</li>
+ <li>The pass program itself is in <RT·code>$REPO_HOME/scratchpad</RT·code>.</li>
+ <li><RT·code>$REPO_HOME</RT·code> is the top of a git working tree, and no tracked file in it has a change not committed. What the pass changes is then exactly what <RT·code>git diff</RT·code> shows afterward, and <RT·code>git restore .</RT·code> takes it back.</li>
+ <li>The patch applies, by <RT·code>git apply --check</RT·code>; or it was applied before, by <RT·code>git apply --reverse --check</RT·code>, and is not applied again.</li>
+ </ol>
+ <p>
+ The first four checks guard against a shell out of step with its directory. A role's shell carries its project's <RT·code>REPO_HOME</RT·code>, <RT·code>PATH</RT·code> and tools with it, so a person who takes on a role in one project and then changes into another, to fix something there, has a shell whose environment names one project while its directory is in the other. A pass run there would apply its patch to one checkout while the tools it names act on the other. Requiring the current directory to be <RT·code>$REPO_HOME</RT·code> catches that, and also a shell with no role taken on at all.
+ </p>
+
+ <h1>The change to the data</h1>
+ <p>
+ A pass's change to data changes what git cannot take back, so it is written to be safe to run, and safe to run again:
+ </p>
+ <ol>
+ <li>It refuses while the program has the data open, as by taking the same lock the program takes.</li>
+ <li>It refuses data that is not in the state the pass expects, such as a database of another schema version, saying what it found.</li>
+ <li>Before it changes anything it makes a backup, named for the pass, beside the original, and keeps it. A database is copied through the database's own backup, not as a file.</li>
+ <li>It makes the whole change in one transaction, so an interruption leaves the data as it was.</li>
+ <li>Made before, it says so, and changes nothing.</li>
+ <li>Before a step that takes long, such as the backup of a large database, it says what it is starting, and how large the job is, so the person waiting knows it is working.</li>
+ </ol>
+ <p>
+ So a pass interrupted part way is run again: the patch, applied before, is passed over, and the change to the data is made, or found made.
+ </p>
+
+ <h1>Taking a pass back</h1>
+ <ol>
+ <li>Before the commit: <RT·code>git restore .</RT·code>, and any file the patch added removed, or <RT·code>git apply -R scratchpad/pass_<N>.patch</RT·code>.</li>
+ <li>After the commit: <RT·code>git revert</RT·code> of it.</li>
+ <li>The data: the backup the pass made, put back with the program stopped.</li>
+ </ol>
+
+ <h1>Making a pass</h1>
+ <p>
+ The collaborator commits the work in a copy of the checkout, at the commit the project is at, then makes the patch from that commit to the work, leaving out the documents:
+ </p>
+ <RT·code>
+ > git diff -M --binary <base> HEAD -- . ':!document' > pass_<N>.patch
+ </RT·code>
+ <p>
+ <RT·code>-M</RT·code> carries a renamed file as a rename, and <RT·code>--binary</RT·code> carries a binary file and a file's mode. Before sending it, the collaborator checks that it applies to the base, in a fresh worktree of it: <RT·code>git worktree add /tmp/check <base></RT·code>, then <RT·code>git apply --check</RT·code> there.
+ </p>
+ <p>
+ The pass program follows the conventions of a tool script (see <RT·code>writing_tool-script.html</RT·code>): given nothing it prints its help, which says what the pass holds and what is left for a later pass; its exit status is 0 when done, or done before, 1 when refused, and 2 when given wrong arguments. Its checks begin like this:
+ </p>
+ <RT·code>
+ PROJECT = "<project>"
+ FILENAME__PATCH = "pass_<N>.patch"
+
+ def where__problem():
+ "None when the shell, the directory and this program belong to PROJECT; otherwise what is wrong"
+ repo_home = os.environ.get("REPO_HOME")
+ if not repo_home:
+ return f"no role is taken on: ./setup administrator, in {PROJECT}, first"
+ if os.environ.get("PROJECT") != PROJECT:
+ return f"this shell is set up for {os.environ.get('PROJECT')}, not {PROJECT}"
+ if os.path.realpath(os.getcwd()) != os.path.realpath(repo_home):
+ return f"run it from {repo_home}, the top of {PROJECT}, not from {os.getcwd()}"
+ if os.path.dirname(os.path.realpath(__file__)) != os.path.realpath(os.path.join(repo_home ,"scratchpad")):
+ return f"it is to be in {repo_home}/scratchpad"
+ return None
+ </RT·code>
+
+ </RT·article>
+ </body>
+</html>
<RT·article>
<RT·title
author="Thomas Walker Lynch"
- date="2026-12-01"
+ date="2026-12-02"
title="Introduction to Harmony">
</RT·title>
Because the new project starts with its own git history, work done in it cannot be checked in to the Harmony skeleton by accident.
</p>
<p>
- Leave the Harmony line in the version file. It records which skeleton the project was made from, so that an administrator can later see what has changed in the skeleton since, and bring the project up to date. The administrator tool <RT·code>skeleton_diff</RT·code> compares a project with a Harmony checkout for this purpose.
+ Leave the Harmony line in the version file. It records which skeleton the project was made from, so that an administrator can later see what has changed in the skeleton since, and bring the project up to date. The administrator tools <RT·code>skeleton_diff</RT·code>, which compares a project with a Harmony checkout, and <RT·code>skeleton_update</RT·code>, which brings the project onto the current skeleton, are for this purpose; <RT·code>administrator/document/how-to_update-from-skeleton.html</RT·code> gives how.
</p>
<h1>Taking on a role</h1>
> ./setup developer
</RT·code>
<p>
- <RT·code>setup</RT·code> starts a new bash shell configured for the role, and leaves the person in the role's directory. The prompt shows the project and the role. <RT·code>exit</RT·code> leaves the role and returns to the shell <RT·code>setup</RT·code> was run from, so a role taken on inside another role's shell stacks on it. It is common to have several terminal windows or Emacs shells open, each in a different role; <RT·code>document/role-and-workflow_product-development.html</RT·code> gives an arrangement of them, and its use in Emacs.
+ <RT·code>setup</RT·code> starts a new bash shell configured for the role, and leaves the person in the role's directory; the administrator, who administers the project as a whole, is left at its top, <RT·code>$REPO_HOME</RT·code>. The prompt shows the project and the role. <RT·code>exit</RT·code> leaves the role and returns to the shell <RT·code>setup</RT·code> was run from, so a role taken on inside another role's shell stacks on it. It is common to have several terminal windows or Emacs shells open, each in a different role; <RT·code>document/role-and-workflow_product-development.html</RT·code> gives an arrangement of them, and its use in Emacs.
</p>
<p>
Python programmers will recognize this as similar to a virtual environment. Harmony calls it the project setup, and the command is <RT·code>setup</RT·code> rather than <RT·code>activate</RT·code>. Unlike a Python virtual environment, there is one setup for each role.
<li>Sets <RT·code>ROLE</RT·code>, <RT·code>ROLE_HOME</RT·code> and <RT·code>SETUP</RT·code>.</li>
<li>Sources the project-wide <RT·code>shared/tool/setup</RT·code>, which sets <RT·code>REPO_HOME</RT·code> and <RT·code>PROJECT</RT·code>, sources each project dependency's <RT·code>.init</RT·code> file, then puts <RT·code>shared/tool</RT·code>, <RT·code>shared/made</RT·code> and <RT·code>shared/authored</RT·code> in front of what the dependencies added.</li>
<li>Sources <RT·code>shared/authored/setup</RT·code>, when the project has one, for project-specific additions to every role.</li>
- <li>Puts <RT·code><role>/tool</RT·code> in front of all of these, changes into the role's directory, and sources <RT·code><role>/tool/setup</RT·code>, the setup customized for that role in this project.</li>
+ <li>Puts <RT·code><role>/tool</RT·code> in front of all of these, changes into the role's directory, or for the administrator into <RT·code>$REPO_HOME</RT·code>, and sources <RT·code><role>/tool/setup</RT·code>, the setup customized for that role in this project.</li>
<li>When running inside Emacs, copies the environment to Emacs with <RT·code>env_to_emacs</RT·code>.</li>
</ul>
<p>
<ul>
<li><RT·code>authored/</RT·code> : Source written by the team. Tracked.</li>
<li><RT·code>document/</RT·code> : Documents for developers, such as coding and naming conventions.</li>
- <li><RT·code>experiment/</RT·code> : Informal, short-lived trials.</li>
+ <li><RT·code>experiment/</RT·code> : Informal, short-lived trials, which run the code being developed straight from <RT·code>authored/</RT·code>, without a build or a promotion. Tracked. A formal test runs from <RT·code>consumer/</RT·code> instead, under the tester.</li>
<li><RT·code>scratchpad/</RT·code> : Untracked. Intermediate build files and the staged products of a build.</li>
<li><RT·code>tool/</RT·code> : The developer's tools, including <RT·code>build</RT·code> and <RT·code>promote</RT·code>.</li>
</ul>
</p>
<ul>
<li><RT·code>document/</RT·code> : The project as a whole, such as this introduction.</li>
- <li><RT·code>administrator/document/</RT·code> : Maintaining the project skeleton, adding dependencies, and making releases.</li>
- <li><RT·code>developer/document/</RT·code> : Coding standards, conventions, and the build.</li>
+ <li><RT·code>administrator/document/</RT·code> : Updating the project from the skeleton, adding dependencies, and making releases.</li>
+ <li><RT·code>developer/document/</RT·code> : Coding standards, conventions, the build, and writing an installer.</li>
<li><RT·code>tester/document/</RT·code> : Test plans and testing tools.</li>
<li><RT·code>consumer/<namespace>/document/</RT·code> : Documents released with the work product, such as manuals and API references.</li>
</ul>
<ul>
<li><RT·code>document/role-and-workflow_product-development.html</RT·code> : The roles, how their work interacts, and a shell for each role, in Emacs among others.</li>
<li><RT·code>document/role-and-workflow_product-maintenance.html</RT·code> : Issues, triage, and patching releases.</li>
+ <li><RT·code>document/handing-over-work_numbered-pass.html</RT·code> : Handing work made outside the checkout to the project, in numbered passes.</li>
<li><RT·code>administrator/document/how-to_release.html</RT·code> : Making a release.</li>
</ul>
</p>
<ol>
- <li><RT·term>administrator</RT·term>, in <RT·code>$REPO_HOME</RT·code>: <RT·code>git</RT·code>, such as <RT·code>git apply</RT·code> and <RT·code>git commit</RT·code>, and the scripts that repair or migrate the project's data.</li>
+ <li><RT·term>administrator</RT·term>, in <RT·code>$REPO_HOME</RT·code>: <RT·code>git</RT·code>, such as <RT·code>git commit</RT·code>, and the passes handed to the project, each of which applies its patch and makes any change to the project's data (see <RT·code>handing-over-work_numbered-pass.html</RT·code>).</li>
<li><RT·term>developer</RT·term>, in <RT·code>$REPO_HOME/developer</RT·code>: <RT·code>build</RT·code> and <RT·code>promote</RT·code>.</li>
<li><RT·term>tester</RT·term>, in <RT·code>$REPO_HOME/tester</RT·code>: the tests, run on what was promoted to <RT·code>consumer</RT·code>.</li>
<li>a shell under no role, in <RT·code>$REPO_HOME/scratchpad</RT·code>, for running the installed program as its users do.</li>
</p>
<p>
- Files handed to the project, such as patches and the scripts that come with them, are put in <RT·code>$REPO_HOME/scratchpad</RT·code>, which git ignores, so they never end up in the repository. The administrator applies a patch from there, <RT·code>git apply scratchpad/<name>.patch</RT·code>, and runs a script from there, <RT·code>scratchpad/<name></RT·code>.
+ Files handed to the project, such as a pass's patch and the program that applies it, are put in <RT·code>$REPO_HOME/scratchpad</RT·code>, which git ignores, so they never end up in the repository. The administrator runs a pass from the top of the project, <RT·code>./scratchpad/pass_<N> run</RT·code>, and the pass applies its own patch.
</p>
<p>
</RT·code>
<p>
- <RT·code>setup</RT·code> starts the role's shell inside the buffer's shell, in the role's directory; <RT·code>exit</RT·code> leaves it, back to the shell the buffer started with. A buffer already open is renamed with <RT·code>M-x rename-buffer</RT·code>. The shell under no role is made the same way, named <RT·code>run</RT·code>, with <RT·code>cd ~/project/Jizo/scratchpad</RT·code> and no <RT·code>setup</RT·code>.
+ <RT·code>setup</RT·code> starts the role's shell inside the buffer's shell, in the role's directory, or for the administrator in <RT·code>$REPO_HOME</RT·code>; <RT·code>exit</RT·code> leaves it, back to the shell the buffer started with. A buffer already open is renamed with <RT·code>M-x rename-buffer</RT·code>. The shell under no role is made the same way, named <RT·code>run</RT·code>, with <RT·code>cd ~/project/Jizo/scratchpad</RT·code> and no <RT·code>setup</RT·code>.
</p>
<h2>The role's environment in Emacs</h2>
</RT·code>
<p>
- As each buffer holds one role's work, <RT·code>M-r build</RT·code> in the developer's buffer finds builds, and <RT·code>M-r apply</RT·code> in the administrator's finds the patches applied, with nothing of the other roles among them.
+ As each buffer holds one role's work, <RT·code>M-r build</RT·code> in the developer's buffer finds builds, and <RT·code>M-r pass_</RT·code> in the administrator's finds the passes run, with nothing of the other roles among them.
</p>
<h2>The working directory</h2>
PROJECT_ROLES = ["administrator", "consumer", "developer", "tester"]
+# The administrator administers the project as a whole: git, and the passes
+# handed to the project, are run from the top of the project. So the
+# administrator's shell starts in $REPO_HOME, while every other role's starts
+# in its own directory. The administrator's tools and setup are still in
+# administrator/tool.
+ROLE_WORKING_AT_REPO_HOME = {"administrator"}
+
# Role shells stack: setup run inside a role shell starts a shell in the new
# role, and exiting it returns to the shell it was started from. A loop
# through setup, such as one started from ~/.bashrc, is stopped at this depth.
role_home = os.path.join(repo_home, role)
tool_dir = os.path.join(role_home, "tool")
setup_file = os.path.join(role, "tool", "setup")
+ work_dir = repo_home if role in ROLE_WORKING_AT_REPO_HOME else role_home
env["ROLE"] = role
env["ROLE_HOME"] = role_home
'if [[ -f "shared/authored/setup" ]]; then source "shared/authored/setup"; fi',
'# the role tool directory is searched before everything the shared setup added',
f'PATH="{tool_dir}:$PATH"; export PATH',
- f'cd "{role}"',
- 'if [[ -f "tool/setup" ]]; then',
- ' source "tool/setup"',
+ f'cd "{work_dir}"',
+ f'if [[ -f "{role_home}/tool/setup" ]]; then',
+ f' source "{role_home}/tool/setup"',
f' echo "in environment: {setup_file}"',
'else',
f' echo "not found: {setup_file}"',