I tied our architecture rule package to the docs repository, and my fix kept the bad assumption
While designing the move of our architecture rule package into its own repository, I added a requirement nobody had asked for. The package would record a commit of our central docs repository and fetch its rule text from that commit on every build. When the project owner questioned it, I withdrew the mechanism but kept the assumption that had produced it. Nothing was committed and no code was built from the design, but a second design pass is now needed to take it back out. This is also the second time in two days that I have tied this package to the docs repository through a recorded commit.
Background
We have a tool that checks code against an architecture. It is a prototype for a product that must check architectures written by its users, so it holds no rules of its own. Each architecture reaches it as a package: a manifest, validators, and the statements the checks enforce, each with text shown beside a finding.
Our own architecture is one such package. Its rules are also written as a spec on our documentation site, which lives in a central repository that pins every component repository.
What I was asked and what I did
The request was to move the package into its own repository and have it build against a specific version of the checker. That names one dependency.
I added a second. I reasoned that a copy of the rule text in the new repository would drift from the docs. So I briefed a design in which the package repository keeps a file recording a docs-repository commit, and its build reads the rule text from that commit. Locally it would read the git history of the enclosing checkout. In its own pipeline it would make a second checkout with an access token.
The design that came back also shipped that record file inside the published package, because the package format had no field for it. I then proposed adding such a field to the format.
I described all this to the project owner as “the default I briefed”, seconds after starting the work, in one paragraph of a longer message. By the time they replied, ten design statements had been written or reworded on the site, with nothing to mark them as undecided.
Their question was short: why would an architecture package know about our docs repository at all, when a user’s architecture has no such repository?
Why it was wrong
The package stopped being a package like any other. Our own architecture was meant to prove that any author can package one. Under my design it could not build from a clone of its own repository.
The drift I was guarding against is not a fault. Our docs lead and every implementation trails them until the aligning work is done. The rule package implements the architecture pages in the same way any component implements its design pages. A design change reaches it as an issue, with no pointer back.
The two texts have different readers. The site states the rule as a spec. The package’s text is printed for someone whose code just failed a check, and it should be free to say more, including hints like “Did you mean…?”. Requiring identical wording rules that out.
The precedent I copied had already been ruled against. The record file came from another component, where it had been built to give a fixed target to tests that compared code with the docs. Those tests had been ordered deleted the day before, and my own notes said not to build recorded commits to keep such comparisons alive. I had read that as a ruling about tests. It applied equally to the device itself. The mechanism was also not in the design, which the write-up flagged and I passed over.
I restored a property the move had deliberately given up. While the package lived beside the docs, both shared one commit. I treated losing that as a gap to fill. I did not ask what had changed: the package had grown into a codebase of its own, it needed its own checker pin, and its text serves a different purpose.
The correction kept the premise
I removed the record, the fetch and the shipped file. I then told the next pass to keep the statements in the same file layout as the docs “so a rule change is a plain copy”. I also described the missing equality check as something “left to care”.
Both phrasings still treat the package’s text as a mirror of the site’s. Whoever next notices that nothing checks the two against each other would be set up to build the check again. That framing has to come out as well.
What the brief should have said
- The package repository is an author’s repository like any user’s, and its manifest, validators, tests and statements are its own source files.
- Its build reads its own repository and the checker it pins, and nothing in it names the docs repository.
- Its statement text states the same rule as the site and is written for the reader of a finding.
- A change to the architecture pages is followed by an issue for the package repository, and nothing compares the two texts.
This needed no new design. The generic package format already says where a build takes its statements from.
What I will do differently
- Trace every addition to a sentence in the request. Anything else is my own decision. If it creates a file, a build step or a cross-repository commit order, I ask first and stop until I have an answer.
- Name the harm before guarding against it. “This will drift” needs to say from what, and who is hurt when it does.
- Ask what a second owner’s package would do with the mechanism. Here the answer was nothing.
- Ask what changed when an earlier placement is reversed. The benefit of the old placement is not a requirement on the new one.
- Find a precedent in the design before copying it.
- Treat a workaround as evidence. A format with no place for a fact suggests the fact does not belong there.
- Remove the premise when corrected. Taking out the mechanism alone leaves the reason for it standing.