Auto-application of amendments: known limitations and planned improvements

Auto-application of amendments: known limitations and planned improvements

This page provides the following supplementary information about Lawmaker’s auto-apply feature:

Auto-apply basics

To use auto-apply, refer to the instructions in the user manual here: Applying Amendments

The auto-apply function will only work correctly if you are in a bill project which meets the following criteria:

  • at least one published version of the bill must exist, and that published version must include line numbering (see Publishing a Bill document version )

  • the amendments you choose to apply must contain accurate clause, line, and page references

  • where amendments insert new provisions into the bill, those amendments must consist of well-formed, valid XML

  • the applied amendments' instructions must be insert, leave out, or leave out and insert amendments

  • the wording of the applied amendments must be correct, and must not contain any unnecessary punctuation; for example, an amendment in the form “leave out ____ and substitute ____” will fail to apply, but “leave out ____ and insert ____” will work.

Steps

To apply amendments to a bill, follow these steps:

  1. Select which amendments you wish to attempt to auto-apply from the Amendment Manager tab. The current status of the amendments (Draft, Submitted, Tabled, Agreed) has no impact on auto-apply; amendments at any stage in their lifecycle can be auto-applied to a bill version.

  2. Open the Amendment Actions menu, click ‘Apply amendments’, then select one of the following options:

    • Create a new bill version, to create a new copy of the published bill containing the applied amendments

    • Apply to an existing bill version, to apply to a working version which already exists in the bill project (for example, a version of the bill which already contains some applied amendments)

    • Apply to a bill version which is currently open in the Editor, to apply the amendments to a version of the bill which you’ve already opened up for editing in another tab.
      You can use the latter two options to apply additional amendments to an already created amended copy. This gives you more control over the order in which to apply amendments, and allows you to apply amendments in batches.

  3. Lawmaker will attempt to apply the selected amendments to the bill version. Once this processing step is complete, a green toastie notification will appear in the top-right of the screen telling you how many amendments were successfully applied.

  4. When you view the amended bill version in the Editor, successfully applied amendments will appear as red and blue tracked changes in the body of the bill. They will have corresponding numbered cards on the right-hand side of the window, in the ‘Inline Amendments’ panel. Amendments which could not be applied will appear in the ‘Review’ pane, with an error message. The Inline Amendments pane allows you to click a card and jump to the applied amendment. You can also accept or reject each applied amendment.

  5. You can make further manual edits to the text of this version, before or after accepting the applied amendments, if you need to.

Amendments to Tables

Amendments which insert, leave out, or substitute one or more whole rows are now supported by Lawmaker since version 19. See https://lawmaker.atlassian.net/wiki/spaces/LST/pages/971472897/What+s+new+in+version+19#Auto-applying-amendments

Ensure your amendment contains clause/section/schedule, page and the relevant line information, ensuring that the lines specified will not result in amendments applying part-way through an existing row.

Examples:

Insert: Schedule 18, page 240, line 31, at end insert—

new text in first column | new text in second column

Leave out: Clause 12, page 19, leave out lines 12 to 14

Substitute: Clause 12, page 19, leave out lines 12 to 14 and insert—

new text in first column | new text in second column

Known limitations and bugs

Lawmaker’s auto-apply function allows a large number of amendments to be applied to a bill version without manual intervention. However, there will always be some amendments which fail to auto-apply for various reasons, and will therefore need to be applied to the bill version manually.

If you know which amendments are likely to fail, and the manner in which they tend to fail, you will be better placed to use the auto-apply feature effectively and avoid creating problems in the resulting bill XML. The details of the known limitations listed below should help you to manage any problematic amendments you encounter when creating an “as amended” version of a bill.

In future Lawmaker releases we intend to fix or refine the behaviours listed here.

Move and Divide amendment instructions

Amendments which ‘move’ or ‘divide’ provisions in a bill can’t be auto-applied at present. We plan to extend auto-apply to these instruction types in future. For now, you will have to apply these amendments manually.

Here is an example of an amendment tabled in the House of Commons which moves a clause to a different part of the Bill:

image-20240430-150617.png

Amendments to the Title

Amendments to the Long Title of a bill are not currently supported and cannot be auto-applied.

Incorrect amendment wording sometimes causes amendments to be applied successfully but disappear from the Editor

This issue has been fixed in version 16.2. The original description of the problem is included below for reference.

Amendments which are worded slightly incorrectly sometimes appear to apply successfully (Lawmaker shows a notification to say they were successfully applied), but when the amended bill version is opened in the Editor the amendments are missing - they have not been applied to the bill text and there is no error message relating to the amendments in the Review pane.

There are two known cases of problematic amendments which suffer from this issue:

  1. “leave out … and substitute”: Amendments which use the word ‘substitute’ in place of ‘insert’ will appear to be applied successfully but may not show up in the Editor

  2. amendments which leave out a phrase beginning with punctuation, such as leave out “, and any other costs”: These will also appear to be applied successfully but may not show up in the Editor

We are in the process of fixing the bug which prevents Lawmaker accurately reporting success and failure of auto-applied amendments like these.

Amendment instructions which end with a full-stop

Amendment instructions do not normally end with a full-stop. For example, consider the following amendment, taken from a list of amendments to a real Bill:

Clause 21, page 17, line 33, after “subsection” insert “, and may make consequential amendments of this section”

When auto-applying amendments in Lawmaker, the presence of a full-stop at the very end of the instruction can prevent the amendment from being applied. So the following amendment may fail:

Clause 21, page 17, line 33, after “subsection” insert “, and may make consequential amendments of this section”.

If you notice an extra full-stop at the end of an amendment instruction, it is worth removing it before attempting to auto-apply the amendment.

Amendments which insert new clauses/sections/paragraphs under a new Part, Chapter, or cross-heading

We have removed this limitation in version 18.0 of Lawmaker, and amendments which insert new Parts, Chapters, or cross-headings in the bill should now auto-apply successfully. The new behaviour also extends to amendments which insert new Parts, Chapters, or cross-headings in the Schedules to a bill.

When you accept an amendment which inserts one of these new groupings mid-way through an existing grouping, Lawmaker will tidy up the bill XML and move existing clauses/sections/paragraphs under the appropriate heading.

The original description of this limitation is included below for reference.

Where an amendment inserts or leaves out a mixture of sections or schedule paragraphs and higher-level headings (like Parts, Chapters, or cross-headings), the amendment may not auto-apply successfully. This is because of how the inserted or omitted headings interact with the other provisions in the bill.

Note on XML: In the bill XML, higher-level headings like Parts are not merely titles; they are XML tags which effectively ‘wrap’ (i.e. completely enclose) the provisions which are under that heading. For example, if a Bill contains two Parts, and Part 2 contains sections 4-6, then in the XML of that Bill sections 4-6 are all contained within an XML tag representing Part 2. If an amendment were to insert a new Part after section 5 (that is, mid-way through Part 2), a slightly complex transformation would be required to wrap or unwrap the provisions under that heading in the XML, so that they are instead enclosed by Part 2.

“From beginning to end of line…” or “leave out line…” in an amendment can sometimes create bad XML when applied

Where a sub-section, paragraph, or sub-paragraph exists in a bill and the content of that sub-section or paragraph extends over more than one line, any amendment which leaves out the whole of the first line of that sub-section or paragraph can create bad XML when auto-applied. This is because the amendment instruction is interpreted as though the amendment intends to remove not only the text of that line but the sub-section or paragraph number at the start of the line too - e.g. (1), (2), (a), (b), (i), (ii), (iii). This results in some of the text of that sub-section remaining in the bill but without a number, which is invalid.

This problem does not arise where an instruction leaves out the entirety of a sub-section or paragraph. In those cases, the removal of the number is correct, since the whole of the sub-section or paragraph is being left out. The problem only affects amendments which remove the whole of the first line of a multi-line sub-section or paragraph, leaving behind some other textual content of that sub-section or paragraph.

We intend to fix this particular case in future Lawmaker releases.

Amendments which leave out words to the end of a line conflict with other amendments to that line

We have made some improvements to conflict detection in version 18.0.

Note that the sorting of the amendments on the Amendment Manager tab can have an effect on conflict detection. We recommend using the Sort by Marshalled Order button to sort the amendments on the Amendment Manager tab before selecting them to auto-apply.

When auto-applying multiple amendments which affect a similar part of a bill, Lawmaker will not apply any amendments which appear to overlap or conflict with one another.

There are scenarios in which amendments which do not technically conflict will nevertheless fail to apply because of their proximity. For example, if an amendment leaves out words “from ____ to the end of line x”, and another amendment inserts some text at the end of line x, Lawmaker may not auto-apply the second amendment. We will continue to refine the conflict-detection logic in future Lawmaker releases.

Adjacent amendments are sometimes erroneously flagged as overlapping and can’t be auto-applied

When one amendment leaves out the end of a section, sub-section, Schedule paragraph or sub-paragraph, and another amendment inserts words in a new provision immediately after that one, the two amendments may be deemed to be overlapping and the latter amendment will not auto-apply. Refinements to conflict-detection should help to resolve this problem in a future Lawmaker release.

Amendments which replace lines containing structure with simple text

Where an amendment leaves out multiple lines of structured text (for example, paragraphs (a) and (b) in a subsection) and inserts a new simple line of text, auto-apply may produce unexpected results. The screenshots below show an example of this.

image-20240927-205936.png
Screenshot 1: an applied amendment which leaves out several lines and inserts a single piece of text
image-20240927-210114.png
Screenshot 2: the traditional wording of the amendment
image-20240927-210205.png
Screenshot 3: the result when accepting the amendment in the Editor

Currently, applying and accepting this amendment will result in the newly inserted text disappearing. We intend to fix this problem in a future Lawmaker release.

Accepting amendments sometimes results in unexpected changes

Sometimes amendments are auto-applied successfully, and the deleted and inserted text all appears correctly in the new bill version in the Editor, but clicking the individual accept icon or the “accept all” button to accept those changes in your bill version produces unexpected results. We have identified the following scenarios in which “accept all” behaves unexpectedly:

  • Amendments which span the end of a sub-section and the start of a new sub-section which introduces a quoted structure, as in the following example:

image-20240307-143405.png
  • Amendments which span the whole of a sub-section containing a Quoted Structure and part of the start of the following sub-section:

image-20240307-143507.png
  • Amendments which span the end of a sub-section and the start of the following sub-section where some of the omitted text contains cross-references:

image-20240307-143727.png
  • Amendments which span the end of one definition and the start of another:

image-20240307-143918.png

In each case, auto-applying and accepting these amendments may produce unexpected outcomes: text may be duplicated after accepting, or empty XML elements may be left behind.

Incorrect application of amendments which leave out a particular Schedule and insert another one

An amendment in the form “leave out Schedule x and move the following Schedule--” may produce unexpected output when auto-applied: the new Schedule will be placed at the end of the bill, the omitted schedule will be marked as deleted, but the intervening schedules (between the omitted Schedule and the new Schedule at the end of the bill) will also be marked as deleted.

Hints and tips

Create a duplicate working version before accepting amendments

It’s advisable to create a duplicate version or a snapshot of the bill version containing all applied (but not accepted) amendments.

To do this, use one of the following methods:

This will ensure you have a backup version you can return to if you find that accepting the amendments results in unexpected textual changes.

If amendments fail to auto-apply, check the wording and the clause, line, and page information

Small errors in the instruction text of an amendment may prevent auto-application from working - for example, if the line reference is wrong. Additionally, the structure of the XML in the target location of the amended bill may mean that certain amendments fail to apply, for any of the known limitations listed above.

If you notice something in an amendment which may need to be changed before applying it (such as incorrect amendment wording or problematic interaction of the amendment XML and bill XML), consider creating a copy of that amendment and opening it in a temporary list to make changes to the wording; see Moving or copying amendments to a different stage (including ping pong motions) | How to copy amendments or motions to another stage

After editing the copied amendment, you can attempt to apply it.