documents brought uptodate
authorThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Wed, 2 Dec 2026 00:07:17 +0000 (00:07 +0000)
committerThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Wed, 2 Dec 2026 00:07:17 +0000 (00:07 +0000)
administrator/document/how-to_add-project-dependency.html
administrator/document/how-to_release.html
developer/document/naming_file-and-directory.html
developer/document/single-file_C-module-and-namespace.html
document/introduction_Harmony.html
document/role-and-workflow_product-development.html
document/role-and-workflow_product-maintenance.html
document/writing_tool-script.html
shared/project-dependency/.gitignore
shared/project-dependency/Python.org

index 327a28c..b6b1dbc 100644 (file)
@@ -24,7 +24,7 @@
     <RT·article>
       <RT·title
         author="Thomas Walker Lynch"
-        date="2026-10-09"
+        date="2026-12-01"
         title="How to add a project dependency">
       </RT·title>
 
@@ -43,7 +43,7 @@
       <h1>What the skeleton relies on</h1>
 
       <ul>
-        <li><RT·code>project</RT·code> : A link to <RT·code>../../../</RT·code>, the directory that holds this project and its siblings. It comes with the skeleton. Links to dependencies are made through it, so they are relative and stay correct in every clone.</li>
+        <li><RT·code>project</RT·code> : A link to <RT·code>../../../</RT·code>, the directory that holds this project and its siblings. It comes with the skeleton, and is tracked. Links to dependencies are made through it, so they are relative, and each clone makes its own.</li>
         <li><RT·code>&lt;name&gt;.init</RT·code> : A bash script that every role setup sources, for every role, each time a person takes on a role. It puts the dependency into the environment, typically by adding to <RT·code>PATH</RT·code> or exporting variables.</li>
         <li><RT·code>&lt;name&gt;.org</RT·code> or <RT·code>&lt;name&gt;.html</RT·code> : Notes on how the dependency was installed, so that each team member can repeat the installation after cloning. Short notes may instead be comments at the top of <RT·code>&lt;name&gt;.init</RT·code>.</li>
         <li><RT·code>&lt;name&gt;.install</RT·code> : Optional. A script that carries out the installation, where it can be automated. A person runs it; setup never does.</li>
       <ul>
         <li>Make it quick, and safe to run any number of times.</li>
         <li>Do not install, build, or download anything from it.</li>
-        <li>Test that the dependency is present before using it, so that a clone without the dependency still sets up.</li>
+        <li>Test that the dependency is present, and runs, before using it, so that a clone without the dependency, or with one broken, still sets up.</li>
         <li>Print nothing in normal use. A notice for the administrator role, when the dependency is missing, is fine.</li>
       </ul>
       <p>
         <RT·code>Python.init</RT·code>, which comes with the skeleton, is an example:
       </p>
       <RT·code>
-        if [[ -d "$REPO_HOME/shared/project-dependency/Python-3.12.3/bin" ]]; then
-          PATH="$REPO_HOME/shared/project-dependency/Python-3.12.3/bin:$PATH"
-        else
+        # Python.init
+        # --------------------------------------------------------------------------------
+        # Put the project's Python build at the front of PATH, but only when it runs.
+        #
+        # Every '#!/usr/bin/env python3' script the person runs, their own tools
+        # included, takes the first python3 on PATH. A build that cannot start, for
+        # example one that lost its libpython after its directory moved, must not be
+        # put there, or all of those scripts fail with it. The test runs the
+        # interpreter once with an empty program.
+
+        python_dp="$REPO_HOME/shared/project-dependency/Python-3.12.3"
+        if [[ ! -e "$python_dp" ]]; then
           if [[ "$ROLE" == "administrator" ]]; then
-             echo "Notice: Local Python-3.12.3 bin not found. Using system Python."
+            echo "Python.init: no $python_dp; using the system python3"
           fi
+        elif "$python_dp/bin/python3" -c '' 2&gt;/dev/null; then
+          PATH="$python_dp/bin:$PATH"
+        else
+          echo "Python.init: $python_dp/bin/python3 does not run; using the system python3" &gt;&amp;2
+          echo "Python.init: run it directly to see why, and see Python.org beside this file" &gt;&amp;2
         fi
+        unset python_dp
       </RT·code>
 
       <h2>Write the installation notes</h2>
       <p>
-        Record what was installed, where it came from, and the commands used, in <RT·code>&lt;name&gt;.org</RT·code>, <RT·code>&lt;name&gt;.html</RT·code>, or comments in the init file. A team member who has cloned the project follows these notes to install the dependency, and then recreates the link if it is not tracked.
+        Record what was installed, where it came from, and the commands used, in <RT·code>&lt;name&gt;.org</RT·code>, <RT·code>&lt;name&gt;.html</RT·code>, or comments in the init file. A team member who has cloned the project follows these notes to install the dependency, and then makes the link.
       </p>
 
-      <h2>Decide what is tracked</h2>
+      <h2>What is tracked</h2>
       <p>
-        The skeleton's <RT·code>.gitignore</RT·code> tracks itself, the <RT·code>project</RT·code> link, and files ending in <RT·code>.init</RT·code>, <RT·code>.install</RT·code>, <RT·code>.org</RT·code>, and <RT·code>.html</RT·code>. Everything else in the directory is ignored. To track a dependency's link, so that it arrives with every clone, add a line naming it:
+        The skeleton's <RT·code>.gitignore</RT·code> tracks itself, the <RT·code>project</RT·code> link, and files ending in <RT·code>.init</RT·code>, <RT·code>.install</RT·code>, <RT·code>.org</RT·code>, and <RT·code>.html</RT·code>. Everything else in the directory is ignored, the links to dependencies among them.
       </p>
-      <RT·code>
-        !&lt;name&gt;
-      </RT·code>
       <p>
-        A tracked link points at nothing until the dependency is installed beside the project, which is why init files test for the dependency before using it.
+        A link is not tracked because it names a directory that is there only where the dependency was installed. Each clone makes its own, following the notes, so a clone holds the links to what it has installed, and no link points at nothing. The init file tests for the dependency before using it, so a clone that has not installed it yet still sets up.
       </p>
 
       <h2>Commit</h2>
       <p>
-        Add the init file, the notes, the <RT·code>.gitignore</RT·code> change, and any tracked link, then commit.
+        Add the init file and the notes, then commit. The link stays out of the commit.
       </p>
 
     </RT·article>
index 0f33c4a..f52dea1 100644 (file)
@@ -26,7 +26,7 @@
     <RT·article>
       <RT·title 
         author="Thomas Walker Lynch" 
-        date="2026-06-24" 
+        date="2026-12-01" 
         title="How to release a project">
       </RT·title>
 
 
       <h1>Make the release branch</h1>
       <p>
-        The <RT·term>administrator</RT·term> executes the release. Open a terminal. Enter the project workspace.
+        The <RT·term>administrator</RT·term> executes the release. Open a terminal. From the top directory of the project, take on the administrator role.
       </p>
       <RT·code>
-        > . setup administrator
+        > ./setup administrator
       </RT·code>
 
       <p>
index c597855..f26f9ea 100644 (file)
     <RT·article>
       <RT·title 
         author="RT" 
-        date="2026-03-09" 
+        date="2026-12-01" 
         title="File and directory naming conventions">
       </RT·title>
 
       <RT·TOC level="1"></RT·TOC>
 
-      <h1>Program file system objects</h1>
-
+      <h1>Where the rules are</h1>
       <p>
-        Harmony files and directories are considered to be program file systems objects.
+        The rules for names are RT culture's, given in RT-Style, in <RT·code>RT-code-format.html</RT·code>; where this document and RT-Style differ, RT-Style is the authority. This document gives how the rules apply to the files and directories of a Harmony project. Harmony's files and directories are program file system objects: their names follow the rules for identifiers.
       </p>
 
-      <h2>Files</h2>
+      <h1>Words and components</h1>
       <p>
-        Files that hold a single class, have he same base name as that class. If a file holds multiple classes, but there is a class of primary importance and auxiliary classes, the file carries the name of the primary class.
+        A name is made of components, the most general first, each later one narrowing it: <RT·code>introduction_Harmony</RT·code>, <RT·code>how-to_release</RT·code>, <RT·code>role-and-workflow_product-development</RT·code>.
       </p>
+      <ol>
+        <li>Within a component, words are joined by a hyphen; components are joined by an underscore. The hyphen binds tighter, so a hyphenated name sits whole inside an underscore compound.</li>
+        <li>A proper noun keeps its own form and capitalization, as a component of its own: <RT·code>Man-In-Grey</RT·code>, <RT·code>RT-Style</RT·code>, <RT·code>Account-Tree</RT·code>.</li>
+        <li>A name says what the file is. <RT·code>Definition.py</RT·code> says nothing, since every Python file defines something.</li>
+        <li>Spaces are not used in program file names.</li>
+      </ol>
 
+      <h2>Where a hyphen is not allowed</h2>
       <p>
-        If a file represents a module or name space, follow the same naming conventions specified for classes and name spaces in the <RT·code>format_RT·code.html</RT·code> document.
+        Where a language forbids a hyphen in a name, such as the file name of a module the language imports by that name, the name is demoted: each hyphen becomes an underscore, and each underscore becomes a double underscore, so the demoted form can be turned back. <RT·code>Man-In-Grey_gate</RT·code> becomes <RT·code>Man_In_Grey__gate</RT·code>. The demoted form is used only where the language forces it.
       </p>
 
-      <p>
-        Other program files follow the same naming conventions specified in the <RT·code>format_RT·code.html</RT·code> document for an identifier of the
-        contained or related language.
-      </p>
-
-      <h2>Hyphens and spaces</h2>
-
-      <p>In a C language culture, file names use underscores between words. In a Lisp language culture use snake-kebab_case. Spaces are generally not used in program file names. Though the Harmony skeleton is language agnostic, it was first used with C, hence file names use primarily underscores.
-      </p>
-
-
-      <h1>Program Directories</h1>
-      <p>
-        A directory that is a package, follows the convention for name spaces.
-      </p>
+      <h1>Files holding code</h1>
+      <ol>
+        <li>A file that holds a single class has the same base name as that class. A file holding a class of primary importance and auxiliary classes carries the name of the primary class.</li>
+        <li>A module is a namespace. The file named for the namespace alone is its main module, such as <RT·code>Guard.py</RT·code>; a file specific to it carries the namespace before a middle dot, such as <RT·code>Guard·WellFormed.py</RT·code>; an application's files parallel these inside its own namespace, such as <RT·code>EmplaceBio·Guard.py</RT·code>.</li>
+        <li>A directory already sets the namespace for the files in it, so the files inside a project's own directory do not repeat it.</li>
+      </ol>
 
+      <h2>Suffixes</h2>
       <p>
-        A directory that is used to give the contained files a property is an identifier.
-      </p>
-      
-      <p>
-        What is a reasonable primary property for a set of files? Perhaps:
+        A file is given a further property by a dot suffix before its language's extension, and the build tools read these to know how to process it:
       </p>
-      <ul>
-        <li>Who uses each file with this property. Home directories are named like this.</li>
-        <li>The role of the people using the file. The <RT·code>developer</RT·code> and <RT·code>tester</RT·code> directories were named in this manner.</li>
-        <li>What program are the files for.</li>
-        <li>The generic category of program said files are for. We prefer the names <RT·code>authored</RT·code> and <RT·code>made</RT·code>. <RT·code>authored</RT·code> files are those written by humans or AI, while <RT·code>made</RT·code> files are products of tools.</li>
-      </ul>
+      <ol>
+        <li><RT·code>.lib.c</RT·code> : library source, compiled to an object file and added to the project's library archive.</li>
+        <li><RT·code>.CLI.c</RT·code> : a program's source, made into a stand-alone executable.</li>
+        <li><RT·code>.kmod.c</RT·code> : kernel module source.</li>
+      </ol>
 
-      <h1>Property indicators on files</h1>
-      <p>
-        We add a second property to a file using dot extensions to the file's name. We can extend the dot suffix model by using multiple dot suffixes. File name extensions are used to signal to the build tools how the file is to be processed:
-      </p>
-      <ul>
-        <li><RT·code>.cli.c</RT·code> : Compiler fodder made into a stand-alone executable.</li>
-        <li><RT·code>.lib.c</RT·code> : Library code source, compiled as an object file and added to the project archive.</li>
-        <li><RT·code>.mod.c</RT·code> : Kernel module sources.</li>
-      </ul>
+      <h1>Directories</h1>
+      <ol>
+        <li>A directory's name is a property each file in it has, so it is rarely plural: a directory of tests is named <RT·code>test</RT·code>. The introduction, <RT·code>document/introduction_Harmony.html</RT·code>, gives the order in which properties are preferred: role, provenance, capability, lifecycle, tracking.</li>
+        <li>A directory that is a package follows the convention for namespaces.</li>
+        <li>Source to be built is in <RT·code>developer/authored/&lt;Namespace&gt;.&lt;Tool&gt;</RT·code>, the suffix naming the build component that builds it, such as <RT·code>make</RT·code> for C, or <RT·code>copy</RT·code> for files used as they are.</li>
+        <li><RT·code>authored</RT·code> files were written by people, or by an AI working with them; <RT·code>made</RT·code> files are the products of tools.</li>
+      </ol>
 
       <h1>Exercises</h1>
       <h2>Exercise 1: Program file names</h2>
index 0e6cd17..a004a24 100644 (file)
@@ -26,7 +26,7 @@
     <RT·article>
       <RT·title 
         author="Thomas Walker Lynch" 
-        date="2026-03-11" 
+        date="2026-12-01" 
         title="C modules, namespaces, and the build lifecycle">
       </RT·title>
 
@@ -45,7 +45,7 @@
         The C language lacks native namespaces. To prevent symbol collisions in large projects, RT code format uses a center dot (<RT·code>·</RT·code>) to denote ad hoc namespaces within identifiers. 
       </p>
       <p>
-        A programmer maps the directory structure directly to these namespaces. For example, a file located at <RT·code>authored/ExampleGreet/Math.lib.c</RT·code> belongs to the <RT·code>ExampleGreet</RT·code> namespace and defines the <RT·code>Math</RT·code> module. 
+        A programmer maps the directory structure directly to these namespaces. For example, a file located at <RT·code>authored/ExampleGreet.make/Math.lib.c</RT·code> belongs to the <RT·code>ExampleGreet</RT·code> namespace and defines the <RT·code>Math</RT·code> module; the directory's suffix, <RT·code>make</RT·code>, names the build component that builds it. 
       </p>
       <ul>
         <li>Types and modules use <RT·code>PascalCase</RT·code>.</li>
 
       <h1>Directory structure and namespaces</h1>
       <p>
-        The physical layout of the <RT·code>authored</RT·code> directory dictates how the build orchestrator finds the source code.
+        The physical layout of the <RT·code>authored</RT·code> directory dictates how the build finds the source code. Each namespace is a directory <RT·code>developer/authored/&lt;Namespace&gt;.make</RT·code>, such as <RT·code>developer/authored/ExampleGreet.make/</RT·code>, holding its <RT·code>.lib.c</RT·code>, <RT·code>.CLI.c</RT·code> and <RT·code>.kmod.c</RT·code> files. <RT·code>build</RT·code> passes over a directory without a suffix, with a warning, so there is no flat layout: source that is to be built is in a namespace.
+      </p>
+      <p>
+        Make settings for every namespace go in <RT·code>developer/tool/build_component/project.mk</RT·code>; those for one namespace, in a <RT·code>.mk</RT·code> file beside its source, such as <RT·code>authored/ExampleGreet.make/ExampleGreet.mk</RT·code>, which is staged and promoted with the namespace's library.
       </p>
-      <ul>
-        <li><strong>Flat Structure:</strong> If a project does not utilize namespaces, the <RT·code>.lib.c</RT·code> and <RT·code>.CLI.c</RT·code> files reside directly inside the <RT·code>developer/authored/</RT·code> directory.</li>
-        <li><strong>Namespaced Structure:</strong> If a project utilizes namespaces, the files are grouped into subdirectories matching the namespace name, such as <RT·code>developer/authored/ExampleGreet/</RT·code>.</li>
-      </ul>
 
       <h1>Making the code</h1>
       <p>
-        The developer compiles the code using the <RT·code>make</RT·code> wrapper script located in <RT·code>developer/tool/make</RT·code>. This script accepts two primary arguments: the build command and the target namespace.
+        The developer builds with <RT·code>build</RT·code>, in the developer role. It takes namespaces, or patterns matching them, each followed by the arguments for its build component, separated by colons; without arguments a namespace is given <RT·code>all</RT·code>. Given nothing, <RT·code>build</RT·code> prints its usage and the namespaces it found.
       </p>
 
       <RT·code>
-        > make &lt;command&gt; [namespace]
+        > build &lt;namespace&gt;[:&lt;argument&gt;]* ...
       </RT·code>
 
       <p>
       </p>
 
       <RT·code>
-        > make all ExampleGreet
+        > build ExampleGreet
       </RT·code>
 
       <p>
-        Behind the scenes, the <RT·code>make</RT·code> wrapper assigns the namespace to an environment variable and calls the master orchestrator makefile. The orchestrator detects the namespace, updates the source directory search path to <RT·code>authored/ExampleGreet</RT·code>, and injects the appropriate namespace macros during compilation. 
+        Behind the scenes, <RT·code>build</RT·code> runs the build component the directory's suffix names, <RT·code>developer/tool/build_component/make</RT·code>, with the namespace in the environment. The component points the source directory at <RT·code>authored/ExampleGreet.make</RT·code> and the products at <RT·code>scratchpad/made/ExampleGreet</RT·code>, then runs GNU make on <RT·code>shared/tool/makefile/Harmony.mk</RT·code>, which injects the namespace macros during compilation. <RT·code>build "ExampleGreet:clean:all"</RT·code> cleans, then builds again.
       </p>
       <p>
-         The orchestrator compiles the <RT·code>.lib.c</RT·code> files into object files under <RT·code>scratchpad/build/object/</RT·code>, archives them into a library file, and links the <RT·code>.CLI.c</RT·code> objects into standalone executables. The final artifacts are placed in the <RT·code>scratchpad/made/</RT·code> directory.
+         The makefile compiles the <RT·code>.lib.c</RT·code> files into object files under <RT·code>scratchpad/build/object/</RT·code>, archives them into a library file, <RT·code>lib&lt;project&gt;.a</RT·code>, and links the <RT·code>.CLI.c</RT·code> objects into standalone executables. The library and the executables are placed in <RT·code>scratchpad/made/ExampleGreet/</RT·code>.
       </p>
 
       <h1>Promoting the artifacts</h1>
       </RT·code>
 
       <p>
-        The <RT·code>promote</RT·code> tool compares the contents of <RT·code>developer/scratchpad/made/</RT·code> against <RT·code>consumer/made/</RT·code>. It atomically copies any new or updated files to the consumer workspace, stripping write permissions to enforce the immutability of the deployment target. Once promoted, the <RT·code>hello</RT·code> executable is ready for testing.
+        The <RT·code>promote</RT·code> tool compares the contents of <RT·code>developer/scratchpad/made/</RT·code> against <RT·code>consumer/</RT·code>. It atomically copies any new or updated files to the consumer workspace, stripping write permissions to enforce the immutability of the deployment target. Once promoted, the <RT·code>hello</RT·code> executable is ready for testing.
       </p>
 
     </RT·article>
index 432c63b..c3065e5 100644 (file)
@@ -24,7 +24,7 @@
     <RT·article>
       <RT·title
         author="Thomas Walker Lynch"
-        date="2026-10-09"
+        date="2026-12-01"
         title="Introduction to Harmony">
       </RT·title>
 
@@ -78,7 +78,7 @@
         > ./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. It is common to have several terminal windows or Emacs shells open, each in a different role.
+        <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.
       </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.
         In the new shell, the setup:
       </p>
       <ul>
-        <li>Sets <RT·code>ROLE</RT·code>, <RT·code>ROLE_HOME</RT·code> and <RT·code>SETUP</RT·code>, and puts <RT·code>&lt;role&gt;/tool</RT·code> on the <RT·code>PATH</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>, puts <RT·code>shared/tool</RT·code> and <RT·code>shared/authored</RT·code> on the <RT·code>PATH</RT·code>, and sources each project dependency's <RT·code>.init</RT·code> file.</li>
+        <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>Changes into the role's directory and sources <RT·code>&lt;role&gt;/tool/setup</RT·code>, the setup customized for that role in this project.</li>
+        <li>Puts <RT·code>&lt;role&gt;/tool</RT·code> in front of all of these, changes into the role's directory, and sources <RT·code>&lt;role&gt;/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>
-        Tools rely on this environment. Absolute paths are formed from <RT·code>REPO_HOME</RT·code>, and some tools, such as <RT·code>build</RT·code> and <RT·code>promote</RT·code>, refuse to run outside the role they belong to.
+        The <RT·code>PATH</RT·code> is then searched most specific first: the role's tools, <RT·code>shared/authored</RT·code>, <RT·code>shared/made</RT·code>, <RT·code>shared/tool</RT·code>, the project dependencies, then what the shell had before. Tools rely on this environment. Absolute paths are formed from <RT·code>REPO_HOME</RT·code>, and some tools, such as <RT·code>build</RT·code> and <RT·code>promote</RT·code>, refuse to run outside the role they belong to.
       </p>
 
       <h1>Roles and their directories</h1>
 
       <h1>Building and promoting</h1>
       <p>
-        Building and promotion are separate steps. In the developer role, <RT·code>build</RT·code> makes the work product from <RT·code>developer/authored</RT·code> and stages it on the developer's scratchpad. <RT·code>promote write</RT·code> then copies what changed to <RT·code>consumer/</RT·code>. The result is a <RT·term>promotion candidate</RT·term>, which stays as it is until the next promotion.
+        Building and promotion are separate steps. In the developer role, <RT·code>build</RT·code> makes the work product from <RT·code>developer/authored</RT·code> and stages it on the developer's scratchpad, in <RT·code>developer/scratchpad/made</RT·code>. <RT·code>promote write</RT·code> then copies what changed to <RT·code>consumer/</RT·code>. The result is a <RT·term>promotion candidate</RT·term>, which stays as it is until the next promotion.
       </p>
       <p>
         Source in <RT·code>developer/authored</RT·code> is grouped into directories named <RT·code>&lt;Namespace&gt;.&lt;Tool&gt;</RT·code>. The suffix names the build component in <RT·code>developer/tool/build_component</RT·code> that builds that directory, such as <RT·code>make</RT·code> for C, or <RT·code>copy</RT·code> for files used as they are. Given no arguments, <RT·code>build</RT·code> prints its usage and the namespaces it found. <RT·code>promote</RT·code> given no arguments prints its commands, among them <RT·code>dry write</RT·code>, which shows what <RT·code>write</RT·code> would copy.
 
       <h1>Project dependencies</h1>
       <p>
-        Harmony is language agnostic. When a project uses C, Python, NodeJS, Java, or other software it did not author, the administrator installs that software as a sibling directory of the project and links it in under <RT·code>shared/project-dependency</RT·code>, with an <RT·code>.init</RT·code> file that every role's setup sources to put the dependency into the environment. Installation notes for each dependency sit beside its <RT·code>.init</RT·code> file, so that each team member can repeat the installation after cloning.
+        Harmony is language agnostic. When a project uses C, Python, NodeJS, Java, or other software it did not author, the administrator installs that software as a sibling directory of the project and links it in under <RT·code>shared/project-dependency</RT·code>, with an <RT·code>.init</RT·code> file that every role's setup sources to put the dependency into the environment. Installation notes for each dependency sit beside its <RT·code>.init</RT·code> file, so that each team member can repeat the installation after cloning. The link itself is not tracked: it names a directory that is there only where the dependency was installed, so each clone makes its own, as the notes say.
       </p>
       <p>
         The directory comes with a <RT·code>project</RT·code> link to the directory holding the project and its siblings, through which dependencies are linked, and with Python as an example dependency. The steps are given in <RT·code>administrator/document/how-to_add-project-dependency.html</RT·code>.
         <li><strong>Role</strong> (<RT·code>administrator</RT·code>, <RT·code>developer</RT·code>, <RT·code>tester</RT·code>, <RT·code>consumer</RT·code>): the role, human or AI, that works with the files.</li>
         <li><strong>Provenance</strong> (<RT·code>authored</RT·code>, <RT·code>made</RT·code>): whether a person wrote the file or a tool produced it.</li>
         <li><strong>Capability</strong> (<RT·code>tool</RT·code>, <RT·code>document</RT·code>, <RT·code>experiment</RT·code>): what the file is for.</li>
-        <li><strong>Lifecycle</strong> (<RT·code>scratchpad</RT·code>, <RT·code>stage</RT·code>): how long the file is expected to last, or where it is in promotion.</li>
+        <li><strong>Lifecycle</strong> (<RT·code>scratchpad</RT·code>): how long the file is expected to last.</li>
         <li><strong>Tracking</strong> (<RT·code>tracked</RT·code>, <RT·code>untracked</RT·code>): what version control does with it.</li>
       </ul>
 
         These documents give the details:
       </p>
       <ul>
-        <li><RT·code>document/role-and-workflow_product-development.html</RT·code> : The roles, and how their work interacts.</li>
+        <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>administrator/document/how-to_release.html</RT·code> : Making a release.</li>
       </ul>
index 411b732..5a9e239 100644 (file)
@@ -24,7 +24,7 @@
     <RT·article>
       <RT·title 
         author="Thomas Walker Lynch" 
-        date="2026-03-09" 
+        date="2026-12-01" 
         title="Product development roles and workflow">
       </RT·title>
 
@@ -46,7 +46,7 @@
         > ./setup consumer
       </RT·code>
 
-      <p>This will run a new shell with the proper environment setting. It is common for a person to have multiple shells, terminal sessions, or IDEs open, each running under a different role environment.  Development and tests is a common pair, though tests are intended to be production tests. The developer has an <RT·code>experiment</RT·code> directory for experiments.
+      <p>This will run a new shell with the proper environment setting. It is common for a person to have multiple shells, terminal sessions, or IDEs open, each running under a different role environment; the chapter "A shell for each role" gives an arrangement that works. Development and tests are a common pair, though tests are intended to be production tests. The developer has an <RT·code>experiment</RT·code> directory for experiments.
       </p>
 
       <h3>Administrator role</h3>
       <ol>
         <li>Set up the project directory and keep it in sync with the Harmony skeleton.</li>
         <li>Maintain role environments (apart from role-specific <RT·code>tool/setup</RT·code> files).</li>
-        <li>Install and maintain shared and third_party tools, addressing issues with the project workflow. Note that the term "third_party" encompasses any software not authored within this specific project.</li>
+        <li>Install and maintain the shared tools and the project dependencies, addressing issues with the project workflow. A project dependency is any software the project uses but did not author; it is installed beside the project and linked in under <RT·code>shared/project-dependency</RT·code> (see <RT·code>administrator/document/how-to_add-project-dependency.html</RT·code>).</li>
       </ol>
 
       <h3>Developer role</h3>
       <p>Responsibilities and Boundaries:</p>
       <ol>
         <li>Write and modify <RT·code>authored/</RT·code> source.</li>
-        <li>Run builds and place artifacts in <RT·code>scratchpad/made</RT·code>, then execute the <RT·code>promote write</RT·code> script to copy artifacts to <RT·code>consumer/made</RT·code> for testing.</li>
+        <li>Run builds and place artifacts in <RT·code>scratchpad/made</RT·code>, then execute the <RT·code>promote write</RT·code> script to copy artifacts to <RT·code>consumer/</RT·code> for testing.</li>
         <li>Run experiments in <RT·code>experiment/</RT·code>. These experiments can sometimes be promoted to formal tests, but there is no requirement to do so. The developer role should not blur into the tester role; experiments are informal, whereas tests are formal and retained.</li>
         <li><strong>Strict Boundary:</strong> A developer never writes into the <RT·code>tester/</RT·code> directory. Instead, a developer adds tests to <RT·code>developer/experiment/</RT·code> and offers to share them.</li>
       </ol>
@@ -69,7 +69,7 @@
       <h3>Tester role</h3>
       <p>Responsibilities and Boundaries:</p>
       <ol>
-        <li>Evaluate candidates under <RT·code>consumer/made/</RT·code> and run regression suites to confirm:
+        <li>Evaluate candidates under <RT·code>consumer/</RT·code> and run regression suites to confirm:
           <ul>
             <li>That the code does not crash.</li>
             <li>That consumers do not have a bad experience.</li>
       <p>Responsibilities:</p>
       <ol>
         <li>Act as the end-user simulation environment.</li>
-        <li>Consume and deploy artifacts exclusively from the <RT·code>consumer/made/</RT·code> target.</li>
+        <li>Consume and deploy artifacts exclusively from the <RT·code>consumer/</RT·code> target.</li>
         <li>Never author or modify code; strictly run local builds or deployments for architecture-specific testing.</li>
         <li>Report issues. (Anyone can report an issue, and consumers regularly do).</li>
       </ol>
 
       <h2>External roles</h2>
       <p>
-        These roles drive the project forward but do not have a dedicated <RT·code>setup &lt;role&gt;</RT·code> workspace, as they do not directly build or test the code in that capacity. If these individuals need to interface with the code, they simply put on a workspace role hat, such as administer, developer, tester, or consumer.
+        These roles drive the project forward but do not have a dedicated <RT·code>setup &lt;role&gt;</RT·code> workspace, as they do not directly build or test the code in that capacity. If these individuals need to interface with the code, they simply put on a workspace role hat, such as administrator, developer, tester, or consumer.
       </p>
 
       <h3>Product manager</h3>
 
       <h1>Promotion mechanics</h1>
       <p>
-        Building and promotion are separate activities. The developer compiles and places files in <RT·code>developer/scratchpad/made</RT·code>. The developer then runs <RT·code>promote write</RT·code> to transfer those files to <RT·code>consumer/made</RT·code>. 
+        Building and promotion are separate activities. The developer compiles and places files in <RT·code>developer/scratchpad/made</RT·code>. The developer then runs <RT·code>promote write</RT·code> to transfer those files to <RT·code>consumer/</RT·code>. 
       </p>
       <p>
-        The <RT·code>consumer/made</RT·code> directory is strictly an untracked deployment target. No tools are permitted to rebuild during promotion, and no builds are run directly inside the consumer made directory.
+        The <RT·code>consumer/</RT·code> directory is strictly an untracked deployment target. No tools are permitted to rebuild during promotion, and no builds are run directly inside the consumer made directory.
+      </p>
+
+      <h1>A shell for each role</h1>
+
+      <p>
+        A Harmony project is worked on through its roles, each entered with <RT·code>./setup &lt;role&gt;</RT·code> from the top of the project, <RT·code>$REPO_HOME</RT·code>. When one person wears every hat, the work of all the roles runs side by side, at one keyboard. Whatever the editor, the arrangement that works is a shell for each role, kept open for the whole session, each in its role's own directory:
+      </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>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>
+        <li>a root shell, in a terminal of its own, outside the editor, for installing what was promoted to <RT·code>consumer</RT·code>.</li>
+      </ol>
+
+      <p>
+        Partitioned so, each shell's history holds one kind of work. The administrator's is the project's git history in the making; the developer's is builds; the tester's is test runs. <RT·code>history</RT·code> in a shell, or searching back through its input, finds the command wanted among others of its kind, and reads as a log of that role's part of the session. A shell's working directory does not change, so every path typed in it is relative to the same place, and a command found in its history runs again as it did before.
+      </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/&lt;name&gt;.patch</RT·code>, and runs a script from there, <RT·code>scratchpad/&lt;name&gt;</RT·code>.
+      </p>
+
+      <p>
+        The root shell is kept out of the editor because root does not run code another account can change. Emacs runs under the developer's account, and loads that account's files as code each time it starts: its init file, and every package. Any of that code can send text to any buffer's process, so a root shell in a buffer would take input from code the account can change. A terminal of its own, entered with <RT·code>su</RT·code>, keeps root's input out of that code's reach.
+      </p>
+
+      <h1>Emacs</h1>
+
+      <p>
+        Emacs holds the role shells as buffers, one shell buffer for each, named for its role. Emacs's buffer list, <RT·code>C-x C-b</RT·code>, then reads as the session's layout:
+      </p>
+
+      <RT·code>
+        . * administrator              40279 Shell:run        ~/project/Jizo/
+          * run                      2551302 Shell:run        ~/project/Jizo/scratchpad/
+          * developer                  81001 Shell:run        ~/project/Jizo/developer/
+          * tester                    456830 Shell:run        ~/project/Jizo/tester/
+            *scratch*                    147 Lisp Interaction
+         %* *Messages*                 22707 Messages
+      </RT·code>
+
+      <p>
+        The last column is each shell's working directory, as Emacs follows it. The size column is the buffer's text: a shell buffer keeps everything printed in it, so the session's output can be searched with <RT·code>C-s</RT·code> and saved as a file.
+      </p>
+
+      <h2>Making the shells</h2>
+
+      <p>
+        <RT·code>M-x shell</RT·code> opens a shell in a buffer named <RT·code>*shell*</RT·code>, and called again it goes back to that buffer. Given a prefix argument, <RT·code>C-u M-x shell</RT·code>, it asks for the buffer's name, and a new name makes a new shell. So for each role:
+      </p>
+
+      <RT·code>
+        C-u M-x shell RET developer RET
+        cd ~/project/Jizo
+        ./setup developer
+      </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>.
+      </p>
+
+      <h2>The role's environment in Emacs</h2>
+
+      <p>
+        A shell running in a buffer cannot change the environment of Emacs itself, and Emacs starts the programs it runs, such as those of <RT·code>M-x compile</RT·code> and <RT·code>M-x grep</RT·code>, with its own copy. So inside Emacs, <RT·code>setup</RT·code> runs <RT·code>env_to_emacs</RT·code>, from <RT·code>shared/tool</RT·code>, which gives the buffer the role's <RT·code>REPO_HOME</RT·code>, <RT·code>PROJECT</RT·code>, <RT·code>ROLE</RT·code> and <RT·code>PATH</RT·code>, with <RT·code>exec-path</RT·code> to match. A compile started from the developer's buffer then finds the developer's tools.
+      </p>
+
+      <ol>
+        <li>The values are local to the one buffer whose shell ran <RT·code>setup</RT·code>, found by its process: the other buffers keep their own roles, and killing the buffer discards them.</li>
+        <li>Leaving a role started inside another, with <RT·code>exit</RT·code>, hands the buffer back the outer role's values.</li>
+        <li><RT·code>env_to_emacs</RT·code> reaches Emacs through <RT·code>emacsclient</RT·code>, so Emacs's server must be running: <RT·code>(server-start)</RT·code> in the init file, or <RT·code>M-x server-start</RT·code> once. Without it, <RT·code>setup</RT·code> says so, and the role's shell works as before, Emacs keeping its own environment.</li>
+      </ol>
+
+      <h2>History in a shell buffer</h2>
+
+      <p>
+        A shell buffer has two histories. The shell keeps its own, read with <RT·code>history</RT·code>, and written to the history file when it exits. Emacs keeps the input typed in the buffer, its <RT·term>input ring</RT·term>, one for each buffer:
+      </p>
+
+      <RT·code>
+        M-p, M-n      the previous or next input, to edit and send again
+        M-r           search back through the inputs, incrementally
+        C-c C-l       list the inputs in a buffer of their own
+        C-c C-o       delete the output of the last command
+        C-c C-r       move to the start of the last command's output
+      </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.
+      </p>
+
+      <h2>The working directory</h2>
+
+      <p>
+        Emacs follows a shell's working directory by watching the <RT·code>cd</RT·code>, <RT·code>pushd</RT·code> and <RT·code>popd</RT·code> commands typed in it, and uses it as the buffer's default directory: <RT·code>C-x C-f</RT·code> in the developer's buffer starts in <RT·code>developer/</RT·code>, and <RT·code>M-x compile</RT·code> runs there. A directory changed some other way is not seen: <RT·code>setup</RT·code> changes into the role's directory itself, and so does a script. When a buffer's directory is wrong, <RT·code>M-x dirs</RT·code> asks the shell, and puts Emacs right; Emacs's <RT·code>dirtrack-mode</RT·code>, which reads the directory from the prompt instead, keeps it right when the prompt shows the directory and <RT·code>dirtrack-list</RT·code> is set to match it. A role's shell staying in its directory keeps this right without thought.
+      </p>
+
+      <h1>Other environments</h1>
+
+      <p>
+        A chapter for Eclipse or IntelliJ IDEA waits for someone working in one of them: what was written for them earlier is old, and is not kept here.
       </p>
 
     </RT·article>
index e93f12d..44b95e5 100644 (file)
@@ -24,7 +24,7 @@
     <RT·article>
       <RT·title 
         author="Thomas Walker Lynch" 
-        date="2026-03-10" 
+        date="2026-12-01" 
         title="Product maintenance roles and workflow">
       </RT·title>
 
@@ -81,7 +81,7 @@
 
       <h2>Core developer queue</h2>
       <p>
-        This queue serves the <RT·code>core_developer_branch</RT·code>. A <RT·term>tester</RT·term> writes a test for every issue reported in this queue. Doing so isolates the defect, proves the fix, and guards against future regressions.
+        This queue serves the <RT·code>core-developer_branch</RT·code>. A <RT·term>tester</RT·term> writes a test for every issue reported in this queue. Doing so isolates the defect, proves the fix, and guards against future regressions.
       </p>
 
       <h2>Released product queue</h2>
@@ -91,7 +91,7 @@
 
       <h1>Triage and patching</h1>
       <p>
-        Guided by the project philosophy, the triage team reviews each release queue issue to determine its impact. The team assesses whether the defect affects the <RT·code>core_developer_branch</RT·code>, assuming by default that it probably does. The team also determines if the defect is critical enough to warrant a patch on one or more active release branches.
+        Guided by the project philosophy, the triage team reviews each release queue issue to determine its impact. The team assesses whether the defect affects the <RT·code>core-developer_branch</RT·code>, assuming by default that it probably does. The team also determines if the defect is critical enough to warrant a patch on one or more active release branches.
       </p>
       <p>
         Based on this assessment, the triage team files actionable tickets in the core developer queue. A ticket explicitly specifies its target branches. A ticket will be filed against either the core developer branch, specific release branches, or a combination of both.
         Members of the tester team also file tickets directly into the core developer queue when they discover defects in the core branch.
       </p>
       <p>
-        Responsibility for resolving a ticket depends on its target. The core developer team addresses fixes required on the <RT·code>core_developer_branch</RT·code>. The branch maintenance team addresses fixes required on the <RT·code>release_v&lt;major&gt;</RT·code> branches.
+        Responsibility for resolving a ticket depends on its target. The core developer team addresses fixes required on the <RT·code>core-developer_branch</RT·code>. The branch maintenance team addresses fixes required on the <RT·code>release_v&lt;major&gt;</RT·code> branches.
       </p>
       <p>
         When a release is patched, the branch name remains static. The administrator advances the minor release number in the <RT·code>shared/tool/version</RT·code> file and tags the commit.
index 5942d3f..f98e1af 100644 (file)
@@ -24,7 +24,7 @@
     <RT·article>
       <RT·title
         author="RT"
-        date="2026-10-09"
+        date="2026-12-01"
         title="Writing a tool script">
       </RT·title>
 
@@ -33,7 +33,7 @@
       <h1>Purpose</h1>
 
       <p>
-        A tool is a script a person runs from a role setup to do work on files. This document gives the conventions for how an RT tool presents itself on the command line, reports what it does, and changes files safely. It complements <RT·code>RT-code-format.html</RT·code>, which covers identifier names, layout, and the separation of the <RT·code>CLI()</RT·code> function from the work functions. Those rules apply here and are not repeated.
+        A tool is a script a person runs from a role setup to do work on files. This document gives the conventions for how an RT tool presents itself on the command line, reports what it does, and changes files safely. It complements <RT·code>RT-code-format.html</RT·code>, in the RT-Style project, which covers identifier names, layout, and the separation of the <RT·code>CLI()</RT·code> function from the work functions. Those rules apply here and are not repeated.
       </p>
 
       <p>
         Errors are logged on their own lines with the tag <RT·code>error</RT·code>, the tool carries on with the remaining files, and the exit status is nonzero when any error occurred. Errors in the command line itself are printed to standard error before any work starts.
       </p>
 
+      <h2>The CLI prints the log</h2>
+      <p>
+        The log is printed by the tool's person-facing part, its <RT·code>CLI()</RT·code> function, not by the work functions. A work function says what it did through what it returns, or through an output function it is given, which prints nothing unless its caller passes one that does. A program that includes the tool as a module then calls the work functions without their output, and one work function calls another without the second's log appearing inside the first's.
+      </p>
+
       <h1>Walking directories</h1>
 
       <p>
       </p>
 
       <p>
-        An absolute path written into a file is correct for only one view of the file system. Under the subu arrangement, the master user reaches a sub-user's files through a mapped mount at a different absolute path from the one the sub-user sees. A path recorded by one of them is then unreadable, or points somewhere else, for the other. A relative path is resolved from wherever the file is reached, so it is correct in every view.
+        An absolute path written into a file is correct for only one view of the file system. Under Account-Tree, the master account reaches a child account's files through a mapped mount at a different absolute path from the one the child account sees. A path recorded by one of them is then unreadable, or points somewhere else, for the other. A relative path is resolved from wherever the file is reached, so it is correct in every view.
       </p>
 
       <h1>Changing files safely</h1>
         import sys ,os
         from pathlib import Path
 
-        def work(dirpa_root ,recursive ,preview):
+        def silent(text=""):
+          "an output function that prints nothing"
+          pass
+
+        def work(dirpa_root ,recursive ,preview ,out=silent):
+          "the work; each log line goes to out, which the CLI makes print"
           ...
 
         def print_help():
 
           command ,rest = argv[0] ,argv[1:]
           ...
+          return work(dirpa_root ,recursive ,preview ,out=print)
 
         if __name__ == "__main__":
           sys.exit(CLI())
index a033c31..f8476ee 100644 (file)
@@ -1,6 +1,6 @@
 # shared/project-dependency/.gitignore
-# Tracks the skeleton's parts. Add a ! line for anything else to track,
-# such as a dependency's link.
+# Tracks the skeleton's parts. A dependency's link is not tracked: each
+# clone makes its own, following the notes beside its .init file.
 *
 !.gitignore
 !project
@@ -8,4 +8,3 @@
 !*.install
 !*.org
 !*.html
-!Python-3.12.3
index 8e67c79..ebbe9f7 100644 (file)
@@ -62,10 +62,11 @@ python3 -m pip install <package>
 
 * 6. Link the Project
 
-Python-3.12.3 is linked to a Harmony derived project by default.
+Make the link in the project's shared/project-dependency directory. The 'project' in the link target is literal: it is the link, which comes with the skeleton, to the directory holding the project and its siblings.
 
-See administrator/document/how-to_add-project-dependency.html for details about linking a project, if you want to check the setup.
-
-If you are installing a different version, then at least the Python-3.12.3 version project linking is there as a good example.
+#+begin_src bash
+cd $REPO_HOME/shared/project-dependency
+ln -s project/Python-3.12.3 Python-3.12.3
+#+end_src
 
-Project linking is not difficult, make a sym link to `project/<dependency>`, and then add an init file, as described in administrator/document/how-to_add-project-dependency.html. The 'project' in the link is literal.
+The link is not tracked, so each clone makes its own. Python.init, beside this file, puts the build on PATH once the link is there. For another version, change the version in the link and in Python.init; administrator/document/how-to_add-project-dependency.html gives the details.