Skip to content

Topic Map — Source-Code Discovery

Topic Map answers: what concepts and relationships does existing code suggest, and what evidence supports those hypotheses?

Use it as a brownfield starting point when the code exists before a trusted domain model. Inspect topics, associations, occurrences and evidence; review candidate clusters before promoting them. A discovered dependency is an observation about code, not an approved business boundary.

Use a small codebase or a known module. Be ready to inspect the source evidence behind a suggested topic.

A source-code discovery pass can identify modules, APIs, entities, libraries and their relationships. A Topic Map organizes these observations into topics, associations and occurrences. It helps a newcomer ask where behavior appears to live without assuming the repository already expresses a clean domain design.

An occurrence points to a place where a topic appears. Evidence such as a file and line lets a reviewer inspect the basis of a claim. Confidence can communicate uncertainty, but it is not business approval. A high-confidence dependency observation may still be irrelevant to where the domain boundary should lie.

Suppose several files form a billing cluster. Their structural relationship is a reason to inspect them together. Review what the files do, which business concepts they use and whether their grouping reflects an intentional responsibility or historical convenience. Keep a proposed bounded context tentative until that review provides a stronger basis.

Promotion records a choice to carry a candidate forward. It should preserve the connection to evidence and remain distinguishable from the source observations. Use the authored Context Map and domain models to describe intended design after review. This gives a brownfield project a path from code discovery to deliberate modeling without presenting every extracted label or cluster as an approved statement of business intent.

Inspect a discovered cluster containing Invoice, PaymentClient and a framework adapter.

  1. Follow an occurrence of Invoice to its source.
  2. Compare the business entity with the technical adapter and name their different roles.
  3. Review why the cluster was proposed and whether it reflects one business responsibility.
  4. Promote only a reviewed candidate toward a bounded-context proposal.

The outcome is a candidate supported by inspectable evidence. It still needs agreement about business meaning before becoming a strategic design commitment.

These four exercises are lesson briefs. Their dedicated CtxBazaar recipes and browser launch actions are planned; see Learning with models for available downloads and the meaning of each result.

Exercise Try this Expected observation
Inspect a small module Review topics from a tiny booking module and follow an occurrence to its source. Every accepted observation has inspectable evidence.
Framework versus domain Compare a framework topic with a Booking entity topic. Infrastructure vocabulary is not mistaken for business vocabulary.
Review a cluster Inspect a proposed billing cluster and its dependency evidence. The candidate remains a hypothesis until reviewed.
Promote deliberately Promote one reviewed cluster toward a bounded-context candidate. The promoted candidate and its source evidence remain distinguishable.
  • Treating framework vocabulary as if it were domain vocabulary.
  • Reading confidence as approval or correctness of a business boundary.
  • Discarding the evidence trail when a candidate is promoted.

From a source file to a reviewed boundary candidate. Code occurrences gather into topics; a cluster is outlined; a reviewer follows evidence before deliberately promoting one candidate.

Pause and predict: What does a strong code dependency tell us—and what does it leave undecided?

This is the text storyboard for a proposed short illustrated film. The written walkthrough and exercises are available now; a published movie will be added after its scenes, captions and model references have been reviewed.

Topic-oriented knowledge organization connects concepts to relationships and occurrences in source material. The W3C SKOS primer provides related background on concept schemes, but SKOS and Topic Maps are distinct approaches and this surface does not claim standards conformance. ContextBrew’s Topic Map is a specific source-code discovery representation.

The current surface consumes the output of the import-js workflow. Topics include modules, entities, APIs, components, libraries and tests, with evidence, confidence and hypothesis/promoted status. A useful review follows a proposed relationship back to a file or symbol before trusting it. Promotion expresses a deliberate decision to carry a cluster toward a bounded-context candidate; it does not make all inferred facts authoritative or prove that a suggested domain boundary is correct.

A dependency graph or code intelligence index is useful for structural questions. A hand-authored Context Map records strategic intent, while Knowledge manages contextual sources. Use discovery to inform those models, preserving the distinction between observed structure and intended design.