# A package's names, and watching a linked checkout

How a name written through a package is told apart from the app's own,
and how `jadpo dev` and `jadpo test --watch` follow a package you have
linked to a checkout you are working on.

- **Where a package's name must be unique.** In its package only. Two
  declarations of one package can't share a name
  (`semantic.duplicate_declaration`), but none clashes with the app's,
  of any kind and wherever it is declared (a domain, `shared/`, public or
  not), nor with another package's: `Postcodes.uk.tidy` beside the app's
  action `tidy`, or `Postcodes.UkPostcode` beside the app's
  `UkPostcode` and `ZipCodes.UkPostcode`, are three things. Their file
  names never fold together either, since each package is its own
  folder. A package's library may be named as an app's library or
  domain is, since it is always written through its package.
- **Which one a name means.** In the app, a bare name is always the
  app's and `Postcodes.<name>` always the package's, so returning
  `Postcodes.UkPostcode` where the app's `UkPostcode` is declared is
  `type.mismatch`. Inside a package, a bare name is the package's own. Failures keep their package too: `fails
  Postcodes.InvalidPostcode` and the app's `fails InvalidPostcode` are
  told apart in tests and at runtime.
- **What a watch watches.** The files every load reads: for a linked
  package, its checkout's sources and data, each at its path in the
  package's folder (`packages/postcodes/v2/libraries/uk.jadpo`), and not
  the installed copy, which stays as it was. The watcher reads the lock at
  every look, so `jadpo package link` or `unlink` while `jadpo dev` or
  `jadpo test --watch` runs moves the watch, and `test --watch` reads the
  whole folder again from where it now lives. A save in the checkout gets
  the watcher's guard for a file emptied mid-save. `jadpo dev` loads the
  project afresh on each save, so it needs nothing more.
- **Where its problems show.** At the checkout's paths in `jadpo test`,
  `test --watch` and `jadpo dev`, as `jadpo check` shows them, since
  that is where they are fixed; the rule line still names the save at
  the package's path, as the project reads it.
