Repository navigation
Reconstruct the history of the package heidrun_notebook_ctrl as an interactive web page #7
Description
Build the chosen user scenario 3, "Reconstruct a module's history" (see issue 6), as a report in the form of a large interactive web page. The developer picks a module or a package. Heidrun Data studies the history of the module and builds the report. The reader interacts with the web page to learn about the module.
Records to study
All records come through the command line heidrun_data. No record is collected with Git commands or GitHub commands.
- The source files of the module.
- Every commit that concerns the module, with its message.
- Every issue that concerns the module, with its comments.
- Every pull request that concerns the module, with its comments, reviews, and review comments.
- Every chat session with a coding agent that is linked to those issues, pull requests, commits, or source files.
The chosen module: heidrun_notebook_ctrl
heidrun_notebook_ctrl is the command line tool of Heidrun Notebook. A person or a coding agent uses it to create, list, read, search, update, and delete the files of a notebook. Its history is short and has real decisions: it was created on 20 October 2026 as an empty Commander program, received its six commands within 30 minutes, received a skill for coding agents, then a new way to sign in, a refactoring of its source folders, and an optional comment and author on every write command.
Data check
I made the check with heidrun_data on the database heidrun_data_example_database.sqlite, which holds the repository Heidrun Notebook: 146 commits, 90 issues, 52 pull requests, and 72 chat sessions from 20 October 2026 to 23 October 2026. The data exists:
- 10 commits name the package in their message. Examples: creation, e55a48a6cb, skill for coding agents, d1e8611c6d, sign in by approval, be25a222af, comment and author, 8fac68a303.
- 31 issues name the package in their title or their body. Examples: issue 23, issue 36, issue 96.
- 9 pull requests name the package. Examples: pull request 13, pull request 32, pull request 104.
- 36 chat sessions are linked to those issues, and 9 chat sessions are linked to those pull requests.
What the data does not give:
- The table
commitshas no file names. A commit that changes the package without naming it in its message is found only by reading commits one by one withheidrun_data read commit. - Many issues name the package only in passing. For example, the milestone issues 47, 49, 51, and 52 are about the whole product. The page must separate these issues from the issues about the package.
- The command
heidrun_data read chat_sessionlooks for the chat session files of the folder where it starts. Started intestbed_folder/, it looks for the folder of the repository heidrun_data and fails. Start it in a folder of the repository Heidrun Notebook. - The database was updated on 23 October 2026 at 21:35 UTC. Later records are missing until
heidrun_data updateruns. - The installed command
~/.local/bin/heidrun_datais a link to a file that does not exist, and the installed commandheidrun_code_datadoes not know the option--database. I used the buildtarget/debug/heidrun_data.
The technical decision for the chosen user scenario 1
The decision: the command line tool signs in with an approval in the website, and not with a password in the file .env.
- Issue 23 states the problems of the old way: the password is in clear text in the file
.env, acting as another person needs an edit of that file, and each command makes a new session with a sign in and a sign out. It lists four open questions and three alternatives: the variables in.envas today, asign_incommand that keeps the session in a file, or one token for each person. - A comment of issue 23 gives the chosen design: the tool shows a short code, a signed in person approves the code in the website, and the tool gets its own token, so the tool never sees a password. The comment also names the one assumption that could make the design impossible, and shows a live test with the real server, the real website, and a real browser.
- Pull request 32 and the commit be25a222af made the change.
A second decision tests the rule "say when the reason is missing": the choice of the library Commander. The commit e55a48a6cb adds "an empty Commander program". No issue title or issue body found by heidrun_data states why Commander was chosen, and I did not read the chat sessions yet. If the chat sessions also give no reason, the answer must say that the decision was found and its reason was not found.
The report
The report goes in the folder testbed_folder/outputs/workspace_heidrun_data_example_database/experiment_heidrun_notebook_ctrl_module_history/, with the rules of testbed_folder/AGENTS.md. The sections come from the documented module history report:
- Summary: what the module does today, checked against the current code.
- Origin: when and why the module was introduced, with sources.
- Timeline: the major changes, each with its commits, issues, pull requests, and chat sessions.
- Decisions and constraints: the reasons that people wrote, and the alternatives they named.
- Attempts and outcomes.
- Current relationships: the packages that use the module.
- Open questions: what the records do not answer.
The reader can:
- Click an event on the timeline to see the commit, the issue, the pull request, or the chat session behind it, with a link.
- Filter the timeline by the kind of record: commit, issue, pull request, or chat session.
- Open a decision to see the reason, the alternatives, and the evidence.
Rules
- Every statement links to the original record.
- The page marks each statement as a recorded fact, an interpretation, or unknown. A missing reason is written as unknown and is never filled in with a likely reason.
- Each graph states its data source and its calculation.
- The page is served with
python3 outputs/serve_outputs.pyso that it reloads when it changes.
Done when
- The page for
heidrun_notebook_ctrlopens at the addresshttp://127.0.0.1:8765/workspace_heidrun_data_example_database/experiment_heidrun_notebook_ctrl_module_history/index.html. - The decision of issue 23 is explained in the page with its reason, its alternatives, and its links.
- The choice of Commander is explained in the page with its reason, or with the statement that its reason was not found.
- Every link of the page opens an existing record.
Related: issue 6
Activity
[-]Reconstruct the history of the package data_layer_coding_agents as an interactive web page[/-][+]Reconstruct the history of the package heidrun_notebook_ctrl as an interactive web page[/+]jeromeetienne commentedon Oct 25, 2026
Report: how the module history page was built
This report logs the work, so another person or another coding agent can repeat it and use the experience.
Result
How I built it, in order
heidrun_dataqueries. I choseheidrun_notebook_ctrlbecause it had the most issues (31) and the most commits that name it (10) of the three packages, and a decision with a stated reason (issue 23).heidrun_data read. I searched 15 chat sessions for the word "Commander".collect_module_history.pyrunsheidrun_dataand writesmodule_history_data.json:heidrun_data read commit <hash> --no-diff, started in the folder of the repository.chat_session_issuesandchat_session_pull_requests, and with the tablechat_session_files.module_history_statements.json. Every statement has a status and at least one source. Most sources hold an exact quote.verify_module_history.pyreads each source again withheidrun_dataand tests that the quote is in the record. I tested the script on a false quote and on a false field value: it failed both times, as it must.How it went: problems and fixes
heidrun_datadoes not work. The link~/.local/bin/heidrun_datapoints to a file that does not exist, andheidrun_code_datadoes not know the option--database. I used the buildtarget/debug/heidrun_dataof this repository.read chat_sessionfails intestbed_folder/. It looks for the chat session files of the folder where it starts. The fix is to start it in the folder of the repository Heidrun Notebook. The script does this for everyreadcommand.--database <path>is one word, so the option was "not known". I wrote the option and its value as two words.read issuedoes not accept--no-diff.read pull_requestandread commitdo.read commitwrites a moved file as{src => end_to_end}/file.ts, and writes a path with special characters in quotes. The first table showed these raw texts, and a fake area named"data_fixture. I added a small reader for this notation in the collector, and the 78 paths became 68.sedcommand that does not run on macOS with the command that wrote the file of the timeline, so the file was never written. I saw it when I listed the files, and I wrote the file again. The lesson: do not chain a file write after a command that can fail.python3 -Iblocks the import of a script of the same folder, so the check script ran without-I.node --check.Choices I made
packages/heidrun_notebook_ctrl/. A pull request belongs when its merge commit changes the package or its text names the package. An issue belongs when a commit or pull request of the package says "fixes" or "part of" for it, or when its title or body names the package. A chat session belongs when the data links it to those records or when it wrote a file of the package. A record is "direct" when its link is strong, and "related" when it only mentions the package. Related records are faded, not hidden.heidrun_datasupplies data. This is the rule oftestbed_folder/AGENTS.md. So the page does not read the current source files, and the Summary cannot say what the package does today. I wrote this as an unknown statement.heidrun_data read chat_session <id>with a copy button.fetch. A page opened as a local file cannot load its data, so the page shows a message that explains how to open it through the local server.How to repeat it
testbed_folder/:python3 outputs/serve_outputs.py.python3 collect_module_history.py, thenpython3 verify_module_history.py.http://127.0.0.1:8765/workspace_heidrun_data_example_database/experiment_heidrun_notebook_ctrl_module_history/index.html.The collector expects the build
target/debug/heidrun_data(or the variableHEIDRUN_DATA_COMMAND) and the repository Heidrun Notebook in~/webwork/heidrun_notebook. For another module, change the constants at the top ofcollect_module_history.pyand write a new file of statements by hand.What I would do differently, and what Heidrun Data lacks
commitsthe names of the changed files, with renames resolved. Today oneread commitcall is needed for each commit (146 calls).