What is Mad Mode?
My day job is writing software to support research at the KU Med Center informatics division, though I'm best known for my work on HTML and Web Architecture at W3C.
I'm a family man, which gives a certain perspective on the KC area, America, and the world we live in.
Between all that, I like to tinker. The bane of my existence is doing things I know the computer could do for me. Have you ever had one of those ideas that won't let go, not even to eat or sleep? My mom said the first time she saw me like that was after they gave me tinker-toys for my 3rd or 4th Christmas. She said I was in "mad scientist mode," just like my father, a chemistry professor.
Uploaded 100+ un-categorized transactions
I added a menu item for formatting un-categorized transactions in JSON and POSTing them to the Google Sheet. This works without closing GnuCash.
Handling redirects was interesting. TIL: a POST switches to a GET on a redirect.
Next up:
yarn push-tx-ids
functionality by doing transaction matching within the Google Apps Script.$ git log10
2025-05-30 03:03 cb23ab7 feat(gc-sync1): include account code in push-tx-ids
2025-05-30 03:03 d5bf4c0 feat(sync26): include account code in GnuCash_Uncat
2025-05-30 02:39 d663549 feat(gc-sync1): POST uncat txs works in 1 case
2025-05-30 00:43 874f6c9 docs(gc-sync1): trace imports to modules
2025-05-30 00:06 635f181 feat: format uncategorized splits in JSON
I just about figured out how to test some code using
guile
, outside GnuCash... but... unlike the python bindings, the scheme bindings don't seem to have a way to load / save a file. ugh!2025-05-29 01:05 de87e39 test(gc-sync1): run code with guile, outside gnucash
TODO: restore CapPython to working order; use it to give feedback to LLMs.
Assigned 1 category
~/projects/finquick/packages/gc-sync1$ git branch --show-current
gc-sync1
~/projects/finquick/packages/gc-sync1$ git log10 -n 4
2025-05-26 17:37 e73866b feat(sync-uncat): assign category to 1 split
2025-05-26 17:31 97fb736 feat(gnc-sync1): find uncategorized transactions
2025-05-26 14:35 822a962 test(gc-sync1): simple-checkbook fixture
2025-05-26 14:34 1d68a0a feat(gc-sync1): toward category sync from GnuCash menu item
can those values include capability references?
Do those messages have something like Payload with
content
andcapTable
?(btw... @endo/marshal calls them
body
andslots
and has aCapData
structure analagous toPayload
).I kicked the tires...
but then I looked for a "make a new item" button and instead found a ghost config file with an API key.
Would I use the normal hosted ghost service?
Where's the version control for the content? Can I give that up?
somewhat tempting...
haven't seen these symptoms in quite some time
I think I meant to close this.
Meanwhile, it might be time for a "divest from brave" issue:
I haven't used bitbucket in some time, but I rigged up something close for github comments:
speaking of bitbucket: Software Heritage archived bitbucket hg repositories before bitbucket took them down
kiwix packages wikipedia for local use
https://meta.wikimedia.org/wiki/Data_dump_torrents
looks like animating it is non-trivial... mediawiki and such
ah... kiwix...
magnet link:
symptoms seem to have gone; I'm not sure why.
fixed in d839d4c
quickjs seems to support single file deployment.
I kicked the tires on quickjs today: quickjs-web in finquick
1b85413
but the sqlite integration that I tried seems to be buggy.I haven't used sandstorm locally for some time.
I haven't been using sandstorm for some time; I didn't invest much for lack of backups:
looks like some point was about a year ago...
106517f was merged
This is an approach to
I was going to re-scope / narrow that one, but I realize I already have the reduced scope here.
I don't use it these days, but I did get it working.
let's leave any more write-up out of scope.
I'm not using mysql any more.
in the repo with the data:
2022-10-04 22:50 32bfbad feat: export sqlite db in ndjson using sqlite-diffable
Brainstorming Approaches to the issue
ack: "we" = me with a generative AI chatbot. I'm conflicted about the ethics of using this stuff, but I'm trying it out.
We initially considered several approaches to address the concurrent access challenge:
Application-Level Locking/Coordination: We thought about having Finquick respect GnuCash's
gnlock
by only performing write operations when the lock was clear, or operating in a read-only mode when GnuCash is active. But GnuCash takes the lock when we open the file and doesn't give it up until we close it.Automated GnuCash Control: We considered scripting the operating system to close GnuCash before Finquick's "pull" operations and re-open it afterward. While this automates manual steps, it still relies on GnuCash being closed, interrupting the user workflow.
Direct Database Manipulation: We briefly explored directly writing to the underlying database (SQLite, PostgreSQL, MySQL) while GnuCash was open. However, we quickly identified this as highly risky due to GnuCash's in-memory data model and the potential for data corruption and inconsistencies, which GnuCash's
gnlock
mechanism is designed to prevent.GnuCash Internal Scripting (Scheme/Python): This emerged as the most promising path to eliminate the stop/start workaround and achieve our goal of continuous data integration. By running scripts within an open GnuCash instance, the script operates within GnuCash's own lock. This allows modifications without external conflicts, leveraging GnuCash's own internal API for data integrity and eliminating the need to stop and start the application. We decided to focus on Scheme due to the user's team's familiarity with it, and its native integration with GnuCash's core.
Current Workflow Challenges
To focus the search for solutions, we reflected on a workflow that currently suffers from this issue:
gnlock
conflicts and potential data corruption, and then restart GnuCash afterward. This stop/start cycle is the primary inefficiency we aim to eliminate.Sometimes we update the db while GnuCash is running and holding the lock; it works most of the time, but we don't want to rely on it.
For this workflow, internal scripting seems promising.
Progress on GnuCash Scheme Scripting:
We embarked on a challenging but fruitful journey to establish a working Scheme scripting environment within GnuCash, which has revealed unique API behaviors along the way.
Key Scripting Discoveries for Internal GnuCash Scripting:
Confirmed Code Execution & Menu Integration:
We initially attempted to use standard
gnc:alert
orgnc:display-message
for a simple "Hello World," but these functions proved unavailable.Discovery: We successfully implemented "Hello World" as a GnuCash Report.
Lesson Learned: We used
gnc:define-report
. We discoverd HTML rendering functions (gnc:html-markup-h1
), and therenderer
function itself takes only one argument (report-obj
). We also found that we must encapsulate content withingnc:make-html-document
>gnc:html-document-add-object!
>gnc:make-html-text
.File Locations: We confirmed that GnuCash looks for configuration in
~/.config/gnucash/config-user.scm
and for scripts in~/.local/share/gnucash/
. Our setup uses symlinks to manage these files from a central~/qtrx/gnucash-config/
directory:API Naming Inconsistencies & Introspection Limitations:
A significant hurdle has been the unpredictable naming conventions of core GnuCash Scheme API functions. For instance,
gnc:current-book
was unbound, but we foundgnc-get-current-book
to be the correct function for accessing the current financial book object.Crucially, the standard Scheme
bound?
function is unavailable, which prevents us from safely checking if a function exists before calling it. This leads to crashes on unbound calls and necessitates a methodical, trial-and-error approach (or direct source code inspection) to discover correct function names.MAJOR BREAKTHROUGH: We Found
xaccSplitSetAccount
!ack
search revealing its use inqif-import/qif-to-gnc.scm
and other files within/usr/share/guile/site/3.0/gnucash
and/usr/share/guile/3.0
), we identified the definitive function for modifying a transaction's split account:xaccSplitSetAccount
. This function uses anxacc
prefix and CamelCase naming, indicating a specific internal API. This is a critical step towards programmatically updating categories.Current State:
We now have a confirmed framework for executing Scheme code within GnuCash
and accessing the core
QofBook
object (gnc-get-current-book
). Most importantly,we know how to update a split's account (
xaccSplitSetAccount
). This capability is fundamental to automating the category synchronization process.This works, modulo
gnc-book-get-filename
:Next Steps:
To complete the category-updating script, we plan to identify the precise function names for the remaining core operations within this specific GnuCash build:
Finding Transactions: How to retrieve a list of transactions from the
QofBook
(e.g., to find uncategorized transactions from Finquick).Accessing Splits: How to get the individual splits from a
QofTransaction
object.Looking Up Accounts: How to find a
QofAccount
object by its name (for assigning new categories).Saving the Book: The function to persist all changes we make to the script to the GnuCash file.
We will discover these remaining functions through targeted testing and, if necessary, further inspection of the GnuCash source code's Guile bindings.
guix pull
17:42 connolly@bldbox$ time guix pull
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Authenticating channel 'guix', commits 9edb3f6 to c31662f (1,991 new commits)...
...
News for channel 'guix'
Incompatible upgrade of the Syncthing service
Removable devices now mount under
/run/media/$USER' instead of
/media'Guix System switches to the Shepherd's system log
Linux-libre updated to 6.13
real 2m25.610s
user 2m53.335s
sys 0m1.385s
mastodon-archive ftw
https://github.com/kensanata/mastodon-archive
office-admin:
2025-03-28 18:48 d131c5e feat(toots): mastodon-archive notes
so... what's left?
I think LLMs (and humans) would benefit from a bunch of examples like the airbnb JS style guide: